direction

Function direction 

Source
pub(crate) fn direction(position: [f64; 3]) -> Option<(f64, [f64; 3])>
Expand description

Length r and direction x / r of a displacement x. Scaling by the largest component first keeps both accurate where |x|^2 under- or overflows.

None at the origin, and also where every component is subnormal: 1 / r would overflow there, while regular translations and their derivatives differ from their origin limits by O(|k| r) relative to their size, below rounding for |k| < 1e290.