magnet.geometric_utils.maximum_sq_distance#

magnet.geometric_utils.maximum_sq_distance(points: ndarray) float#

Compute the squared diameter of a set of points.

Computes the maximum squared distance between any two points in the set points.

Parameters:

points (np.ndarray of float) – Coordinates of the points (each row corresponds to a point).

Returns:

maximum squared distance

Return type:

float

Notes

The two points at maximum distance are always vertices of the convex hull of the set of points. If the number of points is large, the convex hull is computed first to speed up computation.