Module units

Source
Expand description

Wrappers to represent an angle with a specific unit.

Wrapping an Angle or an AngleUnbounded with these wrappers enables Display capability.

let angle = 90.0_f32.deg();

assert_eq!(format!("{}", Radians(angle)), "1.5707964 rad");
assert_eq!(format!("{}", Degrees(angle)), "90°");
assert_eq!(format!("{}", Turns(angle)), "0.25 tr");
assert_eq!(format!("{}", Gradians(angle)), "100g");

Structs§

Degrees
Unit wrapper for the degree unit.
Gradians
Unit wrapper for the gradian unit.
Radians
Unit wrapper for the radian unit.
Turns
Unit wrapper for the turn unit.