- qspec. angle ( x , y , axis=-1 )[source]
-
The angle between two vectors
$$ \alpha = \arccos\left(\frac{\vec{x}\cdot\vec{y}}{|\vec{x}||\vec{y}|}\right). $$- Parameters:
-
- xarray_like
The first vectors $\vec{x}$ (arb. units).
- yarray_like
The second vectors $\vec{y}$ (arb. units).
- axisint
The axis along which the vector components are aligned.
- Returns:
-
- alphandarray
The angle $\alpha$ between the vectors
xandy(rad).
- Raises:
-
- ValueError
If the shapes of
xandyare not compatible.