Beispiel #1
0
def spheres_intersect(ar, aR, br, bR):
    """Return whether or not two spheres intersect each other.

    Parameters
    ----------
    ar, br: array-like, shape (n,) in n dimensions
        Coordinates of the centres of the spheres `a` and `b`.
    aR, bR: float
        Radiuses of the spheres `a` and `b`.

    Returns
    -------
    intersecting: boolean
        True if the spheres intersect.
    """
    return vector.vector_mag_sq(ar - br) < (aR + bR) ** 2
 def get_xyzs_actual(self, R_min):
     return [xyz[vector.vector_mag_sq(xyz) > R_min ** 2]
             for xyz in self.xyzs]
 def valid_func(r):
     return (self.valid_func(r) and
             vector.vector_mag_sq(r) > R_min ** 2)
Beispiel #4
0
 def _is_obstructed(self, seps):
     return vector.vector_mag_sq(seps) < self.R ** 2.0