pub struct Coordinate3d { /* private fields */ }Expand description
A three dimensional geographic coordinate expressed as a (latitude, longitude, altitude) triple.
§Examples
use lat_long::{Altitude, Angle, Coordinate3d, Latitude, Longitude};
let lat = Latitude::try_from(47.6204).unwrap();
let lon = Longitude::try_from(-122.3491).unwrap();
let height = Altitude::meters(226.0);
let top_of_seattle_space_needle = Coordinate3d::new_from(lat, lon, height);
println!("{top_of_seattle_space_needle}"); // decimal degrees
println!("{top_of_seattle_space_needle:#}"); // degrees–minutes–secondsImplementations§
Source§impl Coordinate3d
impl Coordinate3d
Sourcepub const fn new(point: Coordinate, altitude: Altitude) -> Self
pub const fn new(point: Coordinate, altitude: Altitude) -> Self
Construct a new 3d coordinate from a 2d point and an altitude.
Sourcepub const fn new_from(
lat: Latitude,
long: Longitude,
altitude: Altitude,
) -> Self
pub const fn new_from( lat: Latitude, long: Longitude, altitude: Altitude, ) -> Self
Construct a new 3d coordinate from a 2d point, expressed as latitude and longitude values, and an altitude.
Sourcepub const fn with_point(self, point: Coordinate) -> Self
pub const fn with_point(self, point: Coordinate) -> Self
Return a new Coordinate3d with the point component replaced.
Sourcepub const fn with_new_point(self, lat: Latitude, long: Longitude) -> Self
pub const fn with_new_point(self, lat: Latitude, long: Longitude) -> Self
Return a new Coordinate3d with the point component replaced by a new 2d coordinate.
Sourcepub const fn with_altitude(self, altitude: Altitude) -> Self
pub const fn with_altitude(self, altitude: Altitude) -> Self
Return a new Coordinate3d with the altitude component replaced.
Sourcepub const fn point(&self) -> Coordinate
pub const fn point(&self) -> Coordinate
Returns the 2d coordinate component of this 3d coordinate.
Sourcepub fn is_on_equator(&self) -> bool
pub fn is_on_equator(&self) -> bool
Returns true if this coordinate lies on the equator.
Sourcepub fn is_northern(&self) -> bool
pub fn is_northern(&self) -> bool
Returns true if this coordinate is in the northern hemisphere.
Sourcepub fn is_southern(&self) -> bool
pub fn is_southern(&self) -> bool
Returns true if this coordinate is in the southern hemisphere.
Sourcepub fn is_on_international_reference_meridian(&self) -> bool
pub fn is_on_international_reference_meridian(&self) -> bool
Returns true if this coordinate lies on the international reference meridian.
Sourcepub fn is_western(&self) -> bool
pub fn is_western(&self) -> bool
Returns true if this coordinate is in the western hemisphere.
Sourcepub fn is_eastern(&self) -> bool
pub fn is_eastern(&self) -> bool
Returns true if this coordinate is in the eastern hemisphere.
Sourcepub fn is_at_sea_level(&self) -> bool
pub fn is_at_sea_level(&self) -> bool
Returns true if this coordinate lies on the equator.
Trait Implementations§
Source§impl Clone for Coordinate3d
impl Clone for Coordinate3d
Source§fn clone(&self) -> Coordinate3d
fn clone(&self) -> Coordinate3d
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more