forked from paul/sinoptik
Extend positions with getters to retrieve lat/lon in radians
This commit is contained in:
parent
5cd2b56176
commit
fd0725be5c
|
@ -55,6 +55,16 @@ impl Position {
|
|||
pub(crate) fn lon_as_str(&self, precision: usize) -> String {
|
||||
format!("{:.*}", precision, self.lon)
|
||||
}
|
||||
|
||||
/// Returns the latitude in radians
|
||||
fn lat_as_rad(&self) -> f64 {
|
||||
self.lat * PI / 180.0
|
||||
}
|
||||
|
||||
/// Returns the longitude in radians
|
||||
fn lon_as_rad(&self) -> f64 {
|
||||
self.lon * PI / 180.0
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Point<f64>> for Position {
|
||||
|
|
Loading…
Reference in New Issue