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