skspatial.objects.Plane.side_point

Plane.side_point(point: Union[numpy.ndarray, Sequence]) int[source]

Find the side of the plane where a point lies.

Parameters
pointarray_like

Input point.

Returns
int

-1 if the point is behind the plane. 0 if the point is on the plane. 1 if the point is in front of the plane.

Examples

>>> from skspatial.objects import Plane
>>> plane = Plane([0, 0, 0], [0, 0, 1])

The point is in on the plane.

>>> plane.side_point([2, 5, 0])
0

The point is in front of the plane.

>>> plane.side_point([1, -5, 6])
1

The point is behind the plane.

>>> plane.side_point([5, 8, -4])
-1

Higher dimensions are supported.

>>> plane = Plane([0, 0, 0, 0], [0, 1, 0, 1])
>>> plane.side_point([0, -10, 4, 1])
-1