Function vec2::norm [−][src]
pub fn norm<'out, T>(out: &'out mut [T; 2], b: &[T; 2]) -> T where
T: Real,
&'a T: Mul<&'b T, Output = T> + Div<&'b T, Output = T>,
Example
let mut v = vec2::new_zero::<f32>(); assert_eq!(vec2::norm(&mut v, &vec2::new_one()), 2_f32.sqrt()); assert_eq!(v, [1_f32 / 2_f32.sqrt(); 2]);