Skip to main content

normalize_quat_batch

Function normalize_quat_batch 

pub fn normalize_quat_batch(
    qx: &mut [f32],
    qy: &mut [f32],
    qz: &mut [f32],
    qw: &mut [f32],
)
Expand description

Normalises a batch of quaternions in place to unit length, eight at a time.

This is the kernel whose reduction (x²+y²+z²+w²) and 1/√ the auto-vectoriser refuses to lane because FP addition is not associative; doing it explicitly is the point of the SIMD path. All four slices must be the same length; a near-zero quaternion is left unchanged (no divide-by-zero).

§Panics

Panics if the four slices do not all have the same length.