Skip to main content

AngleUnits

Trait AngleUnits 

Source
pub trait AngleUnits {
    // Required methods
    fn rad(self) -> AngleRadian;
    fn grad(self) -> AngleGradian;
    fn deg(self) -> AngleDegree;
    fn turn(self) -> AngleTurn;
}
Expand description

Extension methods for initializing angle units.

This trait is implemented for f32 and u32 allowing initialization of angle unit types using the <number>.<unit>() syntax.

§Examples

let radians = 6.28318.rad();
let gradians = 400.grad();
let degrees = 360.deg();
let turns = 1.turn();

Required Methods§

Source

fn rad(self) -> AngleRadian

Radians

Source

fn grad(self) -> AngleGradian

Gradians

Source

fn deg(self) -> AngleDegree

Degrees

Source

fn turn(self) -> AngleTurn

Turns

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AngleUnits for f32

Source§

impl AngleUnits for i32

Implementors§