skspatial.objects.Line.project_vector

Line.project_vector(vector: Union[numpy.ndarray, Sequence]) skspatial.objects.vector.Vector[source]

Project a vector onto the line.

Parameters
vectorarray_like

Input vector.

Returns
Vector

Projection of the vector onto the line.

Examples

>>> from skspatial.objects import Line
>>> line = Line([-1, 5, 3], [3, 4, 5])
>>> line.project_vector([1, 1, 1])
Vector([0.72, 0.96, 1.2 ])