[][src]Function norman::special::normalize_eucl

pub fn normalize_eucl<T: NormEucl<Output = R> + DivAssign<R>, R: Num>(v: &mut T)

Normalizes the vector v according to the euclidean norm, i.e. divides it by its norm.

As long as the implementations of Div and DivAssign on T match, v will be equal to normalized(v) after calling this function.

Attention

Due to numerical errors, v is not guaranteed to have exactly norm 1 after calling this function.

On integer types this function will do complete nonsense since DivAssign is implemented as an integer division for integers.