float

Trait Radians

Source
pub trait Radians {
    // Required methods
    fn _90() -> Self;
    fn _180() -> Self;
    fn _360() -> Self;
    fn deg_to_rad(self) -> Self;
    fn rad_to_deg(self) -> Self;
}
Expand description

Useful constants for radians.

Required Methods§

Source

fn _90() -> Self

Returns radians corresponding to 90 degrees.

Source

fn _180() -> Self

Returns radians corresponding to 180 degrees.

Source

fn _360() -> Self

Returns radians corresponding to 360 degrees.

Source

fn deg_to_rad(self) -> Self

Convert a value to radians from degrees. Equivalent to value * (π / 180).

Source

fn rad_to_deg(self) -> Self

Convert a value to degrees from radians. Equivalent to value * (180 / π).

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 Radians for f32

Source§

fn _90() -> f32

Source§

fn _180() -> f32

Source§

fn _360() -> f32

Source§

fn deg_to_rad(self) -> Self

Source§

fn rad_to_deg(self) -> Self

Source§

impl Radians for f64

Source§

fn _90() -> f64

Source§

fn _180() -> f64

Source§

fn _360() -> f64

Source§

fn deg_to_rad(self) -> Self

Source§

fn rad_to_deg(self) -> Self

Implementors§