qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec.analyze. straight_direction  (  p_0 ,  p_1 ,  axis=-1  )[source]

The normalized directional vector of a straight line through two points

$$ \vec{r} = \frac{\vec{p}_1 - \vec{p}_0}{|\vec{p}_1 - \vec{p}_0|}. $$
Parameters:
p_0array_like

The first point(s) $\vec{p}_0$.

p_1array_like

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.