skspatial.objects.Line.project_point

Line.project_point(point: Union[ndarray, Sequence]) Point[source]

Project a point onto the line.

Parameters
pointarray_like

Input point.

Returns
Point

Projection of the point onto the line.

Examples

>>> from skspatial.objects import Line
>>> Line(point=[0, 0], direction=[8, 0]).project_point([5, 5])
Point([5., 0.])
>>> Line(point=[0, 0, 0], direction=[1, 1, 0]).project_point([5, 5, 3])
Point([5., 5., 0.])