skspatial.objects.Line.from_points

classmethod Line.from_points(point_a: Union[numpy.ndarray, Sequence], point_b: Union[numpy.ndarray, Sequence]) skspatial.objects.line.Line[source]

Instantiate a line from two points.

Parameters
point_a, point_barray_like

Two points defining the line.

Returns
Line

Line containing the two input points.

Examples

>>> from skspatial.objects import Line
>>> Line.from_points([0, 0], [1, 0])
Line(point=Point([0, 0]), direction=Vector([1, 0]))

The order of the points affects the line point and direction vector.

>>> Line.from_points([1, 0], [0, 0])
Line(point=Point([1, 0]), direction=Vector([-1,  0]))