Point

Struct Point 

Source
pub struct Point<A: Angle> { /* private fields */ }
Expand description

The point on the surface of an ellipsoid, represented as the pair (latitude, longitude)

Implementations§

Source§

impl<A: Angle> Point<A>

Source

pub fn new(lat: Latitude<A>, lon: Longitude<A>) -> Self

Construct a point from the given latitude and longitude

Source

pub fn with_coordinates<Lat, Lon>(lat: Lat, lon: Lon) -> Result<Self, A::NumErr>
where Latitude<A>: TryFrom<Lat, Error = A::NumErr>, Longitude<A>: TryFrom<Lon, Error = A::NumErr>,

Construct a point on the surface with some numeric information about latitude and longitude.

§Errors

An overflow of some kind can appear when constructing latitude or longitude from the given numbers.

Source

pub fn north_pole() -> Self

Construct a north pole point (lat=90, lon=0 (by convention)).

Source

pub fn south_pole() -> Self

Construct a south pole point (lat=-90, lon=0 (by convention)).

Source

pub fn is_pole(&self) -> bool

Is the point represents a pole? All the longitudes at pole are singular, so the longitude of the pole can be any meridian.

Source

pub fn antipodal(&self) -> Self

The diametrically opposite point

Trait Implementations§

Source§

impl<A: Debug + Angle> Debug for Point<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A> Display for Point<A>
where A: Display + Angle,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: Angle> PartialEq for Point<A>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<A> Freeze for Point<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for Point<A>
where A: RefUnwindSafe,

§

impl<A> Send for Point<A>
where A: Send,

§

impl<A> Sync for Point<A>
where A: Sync,

§

impl<A> Unpin for Point<A>
where A: Unpin,

§

impl<A> UnwindSafe for Point<A>
where A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.