Trait vector2math::FloatingScalar
source · pub trait FloatingScalar: Scalar + Mul<Output = Self> + Neg<Output = Self> {
const TAU: Self;
const PI: Self;
const EPSILON: Self;
// Required methods
fn sqrt(self) -> Self;
fn cos(self) -> Self;
fn sin(self) -> Self;
fn atan2(self, other: Self) -> Self;
// Provided methods
fn square(self) -> Self { ... }
fn tan(self) -> Self { ... }
fn lerp(self, other: Self, t: Self) -> Self { ... }
fn angle_as_vector(self) -> [Self; 2] { ... }
fn is_zero(self) -> bool { ... }
fn is_near_zero(self, n: Self) -> bool { ... }
}
Expand description
Trait for floating-point scalar numbers
Required Associated Constants§
Required Methods§
Provided Methods§
sourcefn angle_as_vector(self) -> [Self; 2]
fn angle_as_vector(self) -> [Self; 2]
Get the unit vector corresponding to an angle in radians defined by the scalar
sourcefn is_near_zero(self, n: Self) -> bool
fn is_near_zero(self, n: Self) -> bool
Check if the value is within a multiple epsilon range