def trilaterate_v(self, P1, P2, P3, r1, r2, r3):
        r'''
        Find whether 3 spheres intersect
        '''
        temp1 = P2-P1
        e_x = temp1/np.linalg.norm(temp1, axis=1)[:, np.newaxis]
        temp2 = P3-P1
        i = self._my_dot(e_x, temp2)[:, np.newaxis]
        temp3 = temp2 - i*e_x
        e_y = temp3/np.linalg.norm(temp3, axis=1)[:, np.newaxis]
        d = np.linalg.norm(P2-P1, axis=1)[:, np.newaxis]
        j = self._my_dot(e_y, temp2)[:, np.newaxis]
        x = (r1*r1 - r2*r2 + d*d) / (2*d)
        y = (r1*r1 - r3*r3 - 2*i*x + (i*i) + (j*j)) / (2*j)
        temp4 = r1*r1 - x*x - y*y
        return temp4 >= 0
def trilaterate_v ( self , P1 , P2 , P3 , r1 , r2 , r3 ) : temp1 = P2 - P1 e_x = temp1 / np . linalg . norm ( temp1 , axis = 1 ) [ : , np . newaxis ] temp2 = P3 - P1 i = self . _my_dot ( e_x , temp2 ) [ : , np . newaxis ] temp3 = temp2 - i * e_x e_y = temp3 / np . linalg . norm ( temp3 , axis = 1 ) [ : , np . newaxis ] d = np . linalg . norm ( P2 - P1 , axis = 1 ) [ : , np . newaxis ] j = self . _my_dot ( e_y , temp2 ) [ : , np . newaxis ] x = ( r1 * r1 - r2 * r2 + d * d ) / ( 2 * d ) y = ( r1 * r1 - r3 * r3 - 2 * i * x + ( i * i ) + ( j * j ) ) / ( 2 * j ) temp4 = r1 * r1 - x * x - y * y return temp4 >= 0
r'''
        Find whether 3 spheres intersect