skspatial.objects.Vector.cross

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

Compute the cross product with another vector.

Parameters
otherarray_like

Other vector.

Returns
Vector

3D vector perpendicular to both inputs.

Examples

>>> from skspatial.objects import Vector
>>> Vector([1, 0]).cross([0, 1])
Vector([0, 0, 1])
>>> Vector([2, 5]).cross([1, 1])
Vector([ 0,  0, -3])
>>> Vector([1, 0]).cross([0, 1])
Vector([0, 0, 1])
>>> Vector([1, 1, 1]).cross([0, 1, 0])
Vector([-1,  0,  1])