pub struct Ring360(pub f64);
Expand description
Ring360 is a tuple struct encapsulating an f64
Tuple Fields§
§0: f64
Implementations§
source§impl Ring360
impl Ring360
Methods
sourcepub const BASE: f64 = 360f64
pub const BASE: f64 = 360f64
The base is 360.0. All degree values will be modulated by this number
sourcepub fn from_gis(lng180: f64) -> Ring360
pub fn from_gis(lng180: f64) -> Ring360
Alternative constructor if the source degree uses the ±180º GIS system This will not affect the degree conversion, but only the initial rotations value, e.g. (-20).
sourcepub fn degrees(&self) -> f64
pub fn degrees(&self) -> f64
Degrees as 64-bit floats on the 0º to 360º scale around a circle Use value() for the intrinsic value that may extend beyond this range
sourcepub fn to_gis(&self) -> f64
pub fn to_gis(&self) -> f64
Convert the internal 0-360º scale back to the -180º to +180º GIS scale
sourcepub fn rotations(&self) -> i64
pub fn rotations(&self) -> i64
Get the number of rotations. If the total is less than base of 360
sourcepub fn progress(&self) -> f64
pub fn progress(&self) -> f64
Get the intrinsic raw value as a decimal fraction of rotations e.g. 180.0 translates to 0.5 and 450.0 to 1.25
sourcepub fn value(&self) -> f64
pub fn value(&self) -> f64
Returns the raw internal f64 value on a 0-360º scale. Values under 0 or over 360 represent negative or positive rotations
pub fn half_turn() -> f64
pub fn minus_half_turn() -> f64
sourcepub fn as_tuple(&self) -> (f64, i64)
pub fn as_tuple(&self) -> (f64, i64)
Return a simple tuple pair with the 360º degree value and the number of rotations (turns)
sourcepub fn angle_f64(&self, other_value: f64) -> f64
pub fn angle_f64(&self, other_value: f64) -> f64
Calculate the shortest distance in degrees between a Ring360 value and a float64 representing a degree A positive value represents clockwise movement between the first and second longitude
sourcepub fn angle_f64_abs(&self, other_value: f64) -> f64
pub fn angle_f64_abs(&self, other_value: f64) -> f64
Calculate the absolute angle with another 64-bit float in the 0 to 360º system only in a clockwise direction with the 180º to 359.999º representing half to a full turn
sourcepub fn angle(&self, other_value: Ring360) -> f64
pub fn angle(&self, other_value: Ring360) -> f64
Calculate the shortest distance in degrees between two a Ring360 values
sourcepub fn angle_abs(&self, other_value: Ring360) -> f64
pub fn angle_abs(&self, other_value: Ring360) -> f64
Calculate the absolute angle with another Ring360 degree only in a clockwise direction with the 180º to 359.999º representing half to a full turn
sourcepub fn to_radians(&self) -> f64
pub fn to_radians(&self) -> f64
Convert to radians for use with cos(), sin(), tan(), atan() etc.
sourcepub fn sin(&self) -> f64
pub fn sin(&self) -> f64
Calculate sine in the 360º system without explicity converting to radians
sourcepub fn cos(&self) -> f64
pub fn cos(&self) -> f64
Calculate cosine in the 360º system without explicity converting to radians
sourcepub fn tan(&self) -> f64
pub fn tan(&self) -> f64
Calculate tangent in the 360º system without explicity converting to radians
sourcepub fn asin(&self) -> f64
pub fn asin(&self) -> f64
Calculate inverse cosine in the 360º system without explicity converting to and from radians