pub struct Numeric;Expand description
A zero-sized namespace struct providing static math utility methods.
This struct follows the same pattern as App, serving as a namespace for
free-standing mathematical functions such as clamp, lerp, angle conversions,
and interpolation helpers.
Implementations§
Source§impl Numeric
Implements static math utility methods on the Numeric namespace struct.
impl Numeric
Implements static math utility methods on the Numeric namespace struct.
Sourcepub fn deg_to_rad(degrees: f64) -> f64
pub fn deg_to_rad(degrees: f64) -> f64
Sourcepub fn rad_to_deg(radians: f64) -> f64
pub fn rad_to_deg(radians: f64) -> f64
Sourcepub fn normalize_angle(radians: f64) -> f64
pub fn normalize_angle(radians: f64) -> f64
Sourcepub fn angle_delta(from: f64, to: f64) -> f64
pub fn angle_delta(from: f64, to: f64) -> f64
Sourcepub fn distance_squared(a: Vector2D, b: Vector2D) -> f64
pub fn distance_squared(a: Vector2D, b: Vector2D) -> f64
Sourcepub fn sign_or_positive(value: f64) -> f64
pub fn sign_or_positive(value: f64) -> f64
Sourcepub fn distance_3d(a: Vector3D, b: Vector3D) -> f64
pub fn distance_3d(a: Vector3D, b: Vector3D) -> f64
Sourcepub fn distance_squared_3d(a: Vector3D, b: Vector3D) -> f64
pub fn distance_squared_3d(a: Vector3D, b: Vector3D) -> f64
Trait Implementations§
impl Copy for Numeric
impl Eq for Numeric
Source§impl Ord for Numeric
impl Ord for Numeric
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Numeric
impl PartialOrd for Numeric
impl StructuralPartialEq for Numeric
Auto Trait Implementations§
impl Freeze for Numeric
impl RefUnwindSafe for Numeric
impl Send for Numeric
impl Sync for Numeric
impl Unpin for Numeric
impl UnsafeUnpin for Numeric
impl UnwindSafe for Numeric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more