coords.Coords.distance_to_plane#

Coords.distance_to_plane(p, n)#

Return the distance of all points from the plane (p,n).

Parameters#

p: float array_like with shape (3,) or (1,3)

Coordinates of some point in the plane.

n: float array_like with shape (3,) or (1,3)

The normal vector to the plane.

Returns#

float array

Array with shape points_shape() holding the distance of each point to the plane through p and having normal n. The values are positive if the point is on the side of the plane indicated by the positive normal.

See Also#

Examples#

>>> X = Coords([[0.,0.,0.],[2.,0.,0.],[1.,3.,0.],[-1.,0.,0.]])
>>> print(X.distance_to_plane([0.,0.,0.],[1.,0.,0.]))
[ 0.  2.  1. -1.]