Math

Trait Math 

Source
pub trait Math: Sized {
Show 24 methods // Required methods fn abs(self) -> Self; fn recip(self) -> Self; fn sqrt(self) -> Self; fn rsqrt(self) -> Self; fn sin(self) -> Self; fn cos(self) -> Self; fn tan(self) -> Self; fn sincos(self) -> (Self, Self); fn acos(self) -> Self; fn asin(self) -> Self; fn atan(self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn log(self, rhs: Self) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn to_radians(self) -> Self; fn to_degrees(self) -> Self; fn min(self, rhs: Self) -> Self; fn max(self, rhs: Self) -> Self; fn saturate(self) -> Self; fn snorm2unorm(self) -> Self; fn unorm2snorm(self) -> Self; fn clamp(self, minval: Self, maxval: Self) -> Self;
}

Required Methods§

Source

fn abs(self) -> Self

Source

fn recip(self) -> Self

Source

fn sqrt(self) -> Self

Source

fn rsqrt(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn tan(self) -> Self

Source

fn sincos(self) -> (Self, Self)

Source

fn acos(self) -> Self

Source

fn asin(self) -> Self

Source

fn atan(self) -> Self

Source

fn exp(self) -> Self

Source

fn exp2(self) -> Self

Source

fn log(self, rhs: Self) -> Self

Source

fn log2(self) -> Self

Source

fn log10(self) -> Self

Source

fn to_radians(self) -> Self

Source

fn to_degrees(self) -> Self

Source

fn min(self, rhs: Self) -> Self

Source

fn max(self, rhs: Self) -> Self

Source

fn saturate(self) -> Self

Source

fn snorm2unorm(self) -> Self

Source

fn unorm2snorm(self) -> Self

Source

fn clamp(self, minval: Self, maxval: Self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Math for f32

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn rsqrt(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn sincos(self) -> (f32, f32)

Source§

fn acos(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn log(self, y: f32) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn min(self, y: f32) -> Self

Source§

fn max(self, y: f32) -> Self

Source§

fn saturate(self) -> Self

Source§

fn snorm2unorm(self) -> Self

Source§

fn unorm2snorm(self) -> Self

Source§

fn clamp(self, minval: f32, maxval: f32) -> Self

Source§

impl Math for f64

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn rsqrt(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn sincos(self) -> (f64, f64)

Source§

fn acos(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn log(self, y: f64) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn min(self, y: f64) -> Self

Source§

fn max(self, y: f64) -> Self

Source§

fn saturate(self) -> Self

Source§

fn snorm2unorm(self) -> Self

Source§

fn unorm2snorm(self) -> Self

Source§

fn clamp(self, minval: f64, maxval: f64) -> Self

Implementors§

Source§

impl<T> Math for Quat<T>
where T: Copy + Math,

Source§

impl<T> Math for Vec2<T>
where T: Copy + Math,

Source§

impl<T> Math for Vec3<T>
where T: Copy + Math,

Source§

impl<T> Math for Vec4<T>
where T: Copy + Math,