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.
Required Associated Constants§
sourceconst EPSILON: Self
const EPSILON: Self
Machine epsilon value for Self.
sourceconst DOUBLE_EPSILON: Self
const DOUBLE_EPSILON: Self
The double of EPSILON.
Required by Angle::EPSILON because const trait multiplication is unstable.
sourceconst DEG_TO_RAD: Self
const DEG_TO_RAD: Self
Convertion factor from degrees to radians.
sourceconst RAD_TO_DEG: Self
const RAD_TO_DEG: Self
Convertion factor from radians to degrees.
sourceconst TURNS_TO_RAD: Self
const TURNS_TO_RAD: Self
Convertion factor from turns to radians.
sourceconst RAD_TO_TURNS: Self
const RAD_TO_TURNS: Self
Convertion factor from radians to turns.
sourceconst GRAD_TO_RAD: Self
const GRAD_TO_RAD: Self
Convertion factor from gradians to radians.
sourceconst RAD_TO_GRAD: Self
const RAD_TO_GRAD: Self
Convertion factor from radians to gradians.
Required Methods§
sourcefn sin_cos(self) -> (Self, Self)
fn sin_cos(self) -> (Self, Self)
Simultaneously computes the sine and cosine. Returns (sin(x), cos(x)).