skspatial.objects.Vector.angle_between

Vector.angle_between(other: Union[numpy.ndarray, Sequence]) float[source]

Return the angle in radians between the vector and another.

Parameters
otherarray_like

Other vector.

Returns
np.float64

Angle between vectors in radians.

Examples

>>> import numpy as np
>>> from skspatial.objects import Vector
>>> Vector([1, 0]).angle_between([1, 0])
0.0
>>> Vector([1, 1, 1]).angle_between([1, 1, 1])
0.0
>>> angle = Vector([1, 0]).angle_between([1, 1])
>>> np.degrees(angle).round()
45.0
>>> angle = Vector([1, 0]).angle_between([-2, 0])
>>> np.degrees(angle).round()
180.0