示例#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
示例#2
0
 def get_xyzs_actual(self, R_min):
     return [xyz[vector.vector_mag_sq(xyz) > R_min ** 2]
             for xyz in self.xyzs]
示例#3
0
 def valid_func(r):
     return (self.valid_func(r) and
             vector.vector_mag_sq(r) > R_min ** 2)
示例#4
0
 def _is_obstructed(self, seps):
     return vector.vector_mag_sq(seps) < self.R ** 2.0