Trait glm::GenNumVec
[−]
[src]
pub trait GenNumVec<T: BaseNum>: GenNum<T> + GenVec<T> { fn sum(&self) -> T; fn product(&self) -> T; fn min(&self) -> T; fn max(&self) -> T; }
Trait of all vector types that are GenNum.
Required Methods
fn sum(&self) -> T
Returns the sum of all components.
Example
use glm::GenNumVec; // bring the method into scope. let v = glm::vec3(1., 2., 3.); assert_eq!(v.sum(), 6.0);
fn product(&self) -> T
Multiplies all components.
Example
use glm::GenNumVec; // bring the method into scope. let v = glm::vec3(2., 3., 4.); assert_eq!(v.product(), 24.);
fn min(&self) -> T
Returns the minimal value of all components.
Example
use glm::GenNumVec; // bring the method into scope. let v = glm::vec3(1.0, 2.0, 3.0); assert_eq!(v.min(), 1.0);
fn max(&self) -> T
Returns the maximal value of all components.
Example
use glm::GenNumVec; // bring the method into scope. let v = glm::vec3(1.0, 2.0, 3.0); assert_eq!(v.max(), 3.0);