Trait gfxmath_vec3::ops::Norm [−][src]
Normalize a vector
Associated Types
Loading content...Required methods
Loading content...Implementors
impl Norm for &Vec3<f32>[src]
impl Norm for &Vec3<f64>[src]
impl Norm for Vec3<f32>[src]
type Output = Option<Vec3<f32>>
fn norm(self) -> Self::Output[src]
use gfxmath_vec3::ops::Norm; use gfxmath_vec3::Vec3; let a = Vec3::<f32>::new(3.0, 4.0, 0.0); let an = a.norm().unwrap(); assert_eq!(3.0/5.0, an.x); assert_eq!(4.0/5.0, an.y); assert_eq!(0.0, an.z);