Trait angulus::float::Float

source ·
pub trait Float: Sealed + Copy + Add<Output = Self> + Sub<Output = Self> + Mul<Output = Self> + Div<Output = Self> + Rem<Output = Self> + Neg<Output = Self> + PartialOrd + Sized {
Show 17 associated constants and 4 methods const ZERO: Self; const ONE: Self; const EPSILON: Self; const DOUBLE_EPSILON: Self; const TAU: Self; const PI: Self; const FRAC_PI_2: Self; const FRAC_PI_3: Self; const FRAC_PI_4: Self; const FRAC_PI_6: Self; const FRAC_PI_8: Self; const DEG_TO_RAD: Self; const RAD_TO_DEG: Self; const TURNS_TO_RAD: Self; const RAD_TO_TURNS: Self; const GRAD_TO_RAD: Self; const RAD_TO_GRAD: Self; fn sin(self) -> Self; fn cos(self) -> Self; fn tan(self) -> Self; fn sin_cos(self) -> (Self, Self);
}
Expand description

Marker trait for floating-point types that can be used as numerical type for Angle and AngleUnbounded.

This trait is sealed and is implemented for f32 and f64.

Required Associated Constants§

source

const ZERO: Self

The additive identity element of Self (aka 0).

source

const ONE: Self

The multiplicative identity element of Self (aka 1).

source

const EPSILON: Self

Machine epsilon value for Self.

source

const DOUBLE_EPSILON: Self

The double of EPSILON.

Required by Angle::EPSILON because const trait multiplication is unstable.

source

const TAU: Self

The full circle constant (τ)

Equal to 2π.

source

const PI: Self

Archimedes’ constant (π)

source

const FRAC_PI_2: Self

π/2

source

const FRAC_PI_3: Self

π/3

source

const FRAC_PI_4: Self

π/4

source

const FRAC_PI_6: Self

π/6

source

const FRAC_PI_8: Self

π/8

source

const DEG_TO_RAD: Self

Convertion factor from degrees to radians.

source

const RAD_TO_DEG: Self

Convertion factor from radians to degrees.

source

const TURNS_TO_RAD: Self

Convertion factor from turns to radians.

source

const RAD_TO_TURNS: Self

Convertion factor from radians to turns.

source

const GRAD_TO_RAD: Self

Convertion factor from gradians to radians.

source

const RAD_TO_GRAD: Self

Convertion factor from radians to gradians.

Required Methods§

source

fn sin(self) -> Self

Computes the sine (in radians).

source

fn cos(self) -> Self

Computes the cosine (in radians).

source

fn tan(self) -> Self

Computes the tangent (in radians).

source

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

Simultaneously computes the sine and cosine. Returns (sin(x), cos(x)).

Implementations on Foreign Types§

source§

impl Float for f32

source§

const ZERO: Self = 0f32

source§

const ONE: Self = 1f32

source§

const EPSILON: Self = 1.1920929E-7f32

source§

const DOUBLE_EPSILON: Self = 2.38418579E-7f32

source§

const TAU: Self = 6.28318548f32

source§

const PI: Self = 3.14159274f32

source§

const FRAC_PI_2: Self = 1.57079637f32

source§

const FRAC_PI_3: Self = 1.04719758f32

source§

const FRAC_PI_4: Self = 0.785398185f32

source§

const FRAC_PI_6: Self = 0.52359879f32

source§

const FRAC_PI_8: Self = 0.392699093f32

source§

const DEG_TO_RAD: Self = 0.0174532924f32

source§

const RAD_TO_DEG: Self = 57.2957763f32

source§

const TURNS_TO_RAD: Self = 6.28318548f32

source§

const RAD_TO_TURNS: Self = 0.159154937f32

source§

const GRAD_TO_RAD: Self = 0.0157079641f32

source§

const RAD_TO_GRAD: Self = 63.6619759f32

source§

fn sin(self) -> Self

source§

fn cos(self) -> Self

source§

fn tan(self) -> Self

source§

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

source§

impl Float for f64

source§

const ZERO: Self = 0f64

source§

const ONE: Self = 1f64

source§

const EPSILON: Self = 2.2204460492503131E-16f64

source§

const DOUBLE_EPSILON: Self = 4.4408920985006262E-16f64

source§

const TAU: Self = 6.2831853071795862f64

source§

const PI: Self = 3.1415926535897931f64

source§

const FRAC_PI_2: Self = 1.5707963267948966f64

source§

const FRAC_PI_3: Self = 1.0471975511965979f64

source§

const FRAC_PI_4: Self = 0.78539816339744828f64

source§

const FRAC_PI_6: Self = 0.52359877559829893f64

source§

const FRAC_PI_8: Self = 0.39269908169872414f64

source§

const DEG_TO_RAD: Self = 0.017453292519943295f64

source§

const RAD_TO_DEG: Self = 57.295779513082323f64

source§

const TURNS_TO_RAD: Self = 6.2831853071795862f64

source§

const RAD_TO_TURNS: Self = 0.15915494309189535f64

source§

const GRAD_TO_RAD: Self = 0.015707963267948967f64

source§

const RAD_TO_GRAD: Self = 63.661977236758133f64

source§

fn sin(self) -> Self

source§

fn cos(self) -> Self

source§

fn tan(self) -> Self

source§

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

Implementors§