skspatial.objects.Vector.angle_signed

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

Return the signed angle in radians between the vector and another.

The vectors must be 2D.

Parameters
otherarray_like

Other vector.

Returns
np.float64

Signed angle between vectors in radians.

Raises
ValueError

If the vectors are not 2D.

Examples

>>> import numpy as np
>>> from skspatial.objects import Vector
>>> Vector([1, 0]).angle_signed([1, 0])
0.0
>>> np.degrees(Vector([1, 0]).angle_signed([0, 1]))
90.0
>>> np.degrees(Vector([1, 0]).angle_signed([0, -1]))
-90.0
>>> Vector([1, 0, 0]).angle_signed([0, -1, 0])
Traceback (most recent call last):
...
ValueError: The vectors must be 2D.