pub trait AngleUnit {
// Required methods
fn to_radians<T: CoordinateScalar + FromF64>(value: T) -> T;
fn from_radians<T: CoordinateScalar + FromF64>(value: T) -> T;
}Expand description
Unit of plane angle.
Mirrors boost::geometry::degree / boost::geometry::radian from
boost/geometry/core/cs.hpp:41-51 and their role as the
cs_angular_units<Cs>::type in cs.hpp:251-281. The conversion
methods are the Rust analogue of the unnamed scaling factors Boost
inlines inside each strategy.
§Examples
use geometry_cs::{AngleUnit, Degree, Radian};
// 180° == π rad
let rad = Degree::to_radians(180.0_f64);
assert!((rad - core::f64::consts::PI).abs() < 1e-12);
// Round-trip through Radian is the identity.
assert_eq!(Radian::to_radians(1.5_f64), 1.5);Required Methods§
Sourcefn to_radians<T: CoordinateScalar + FromF64>(value: T) -> T
fn to_radians<T: CoordinateScalar + FromF64>(value: T) -> T
Sourcefn from_radians<T: CoordinateScalar + FromF64>(value: T) -> T
fn from_radians<T: CoordinateScalar + FromF64>(value: T) -> T
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".