pub const DEG_TO_RAD: f32 = std::f32::consts::PI / 180.0;
pub const RAD_TO_DEG: f32 = 180.0 / std::f32::consts::PI;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn deg_to_rad() {
assert_eq!((DEG_TO_RAD * 90.0 * 100.0).floor(), 157.0);
assert_eq!((DEG_TO_RAD * 60.0 * 100.0).floor(), 104.0);
assert_eq!((DEG_TO_RAD * -30.0 * 100.0).floor(), -053.0);
}
#[test]
fn rad_to_deg() {
assert_eq!((RAD_TO_DEG * 1.58).floor(), 90.0);
assert_eq!((RAD_TO_DEG * 1.05).floor(), 60.0);
assert_eq!((RAD_TO_DEG * -0.523).floor(), -30.0);
}
}