skspatial.objects.Vector.from_points

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

Instantiate a vector from point A to point B.

Parameters
point_a, point_barray_like

Points defining the vector.

Returns
Vector

Vector from point A to point B.

Examples

>>> from skspatial.objects import Vector
>>> Vector.from_points([0, 0], [1, 0])
Vector([1, 0])
>>> Vector.from_points([5, 2], [-2, 8])
Vector([-7,  6])
>>> Vector.from_points([3, 1, 1], [7, 7, 0])
Vector([ 4,  6, -1])