use std::f32::consts::PI;
pub struct Math {}
impl Math {
pub const SQRT1_2: f32 = std::f32::consts::FRAC_1_SQRT_2;
pub const INT_MIN: i32 = -2147483648;
pub const INT_MAX: i32 = 2147483647;
pub const FLOAT_MIN: f32 = std::f32::MIN;
pub const FLOAT_MAX: f32 = std::f32::MAX;
#[inline]
pub fn to_radians(degrees: f32) -> f32 {
degrees * PI / 180.0
}
#[inline]
pub fn to_degrees(radians: f32) -> f32 {
radians * 180.0 / PI
}
pub fn sign(value: f32) -> i32 {
if value < 0.0 {
-1
} else if value > 0.0 {
1
} else {
0
}
}
}