coords.Coords.distance_to_point#
- Coords.distance_to_point(p)#
Returns the distance of all points to the point p.
Parameters#
- p: float array_like with shape (3,) or (1,3)
Coordinates of a single point in space
Returns#
- float array
Array with shape
points_shape()holding the distance of each point to point p. All values are positive or zero.
See Also#
closest_to_point(): return the point of Coords closest to the given point
Examples#
>>> X = Coords([[0.,0.,0.],[2.,0.,0.],[1.,3.,0.],[-1.,0.,0.]]) >>> print(X.distance_to_point([0.,0.,0.])) [0. 2. 3.1623 1. ]