, x y.
, , , , "" ( ). - (x1, y_1) (x_2, y_2), (x*, y*), :
(1) (x*-x_1)^2 + (y*-y_1)^2 = d^2
(2) (x*-x_2)^2 + (y*-y_2)^2 = d^2
x*, y*, . (x* y* d). , y*, x*:
x* = ((y*-y_1)^2 - (y*-y_2)^2 + x_1^2 - x_2^2) / (2 * (x_1 - x_2))
, , (x_1, y_1) (x_2, y_2) ?
:
(1) (n * (n-1)/2 , ), x* y*, . (x_1, y_1), (x_2, y_2), (x*, y*) .
(2) (x*, y*) 2 ( scipy.spatial.KDTree). (x_1, y_1) (x_2, y_2), (x*, y*).
KD- - O (n log n) (IIRC), O (n ^ 2) .