- qspec.analyze.straight_direction ( p_0 , p_1 , axis = -1 )[source]
The normalized directional vector of a straight through two points $$\vec{r} = \frac{\vec{p}_1 - \vec{p}_0}{|\vec{p}_1 - \vec{p}_0|}.$$
- Parameters:
-
- p_0ndarray | Iterable
The first point(s) $\vec{p}_0$.
- p_1ndarray | Iterable
The second point(s) $\vec{p}_1$.
- axisint
The axis along which the vector components are aligned.
- Returns:
-
- rndarray
The direction $\vec{r}$ of a straight line.