gfxmath_vec2/impls/div/
div.rs

1use core::ops::Div;
2use crate::Vec2;
3
4/// Scalar division with vector
5/// 
6/// ```
7/// use gfxmath_vec2::Vec2;
8/// 
9/// let a = Vec2::<f32>::new(0.5, 2.5);
10/// let b = a / 2.0;
11/// 
12/// assert_eq!( 0.25, b.x);
13/// assert_eq!( 1.25, b.y);
14/// ```
15#[opimps::impl_ops_rprim(Div)]
16#[inline]
17fn div<T>(self: Vec2<T>, rhs: T) -> Vec2<T> where T: Div<Output = T> + Copy {
18    Vec2 { x: self.x / rhs, y: self.y / rhs }
19}