angular-units 0.2.4
Feature-rich library for representing and manipulating angular quantities. Provides strongly-typed structs for six units as well as helper traits for abstracting over the concrete types and doing common operations.
Provided Units:
- Degrees -
Deg<T>
- Radians -
Rad<T>
- Gradians -
Gon<T>
- Turns -
Turns<T>
(1 turn is a full rotation) - Arc minutes -
ArcMinutes<T>
- Arc seconds -
ArcSeconds<T>
Usage:
[]
= "0.2.4"
Examples:
- Converting from Degrees to Radians:
let angle = Deg;
let radians: = angle.into_angle;
- Composing angles from multiple units:
let degrees: = Deg + ArcMinutes + Rad;
- Interpolating between two angles:
assert_eq!
Optional Features:
Angular-units provides optional serde and approx support for all types by enabling their respective features.