[−][src]Struct transit_model::objects::Coord
Fields
lon: f64
lat: f64
Implementations
impl Coord
[src]
pub fn distance_to(&self, other: &Self) -> f64
[src]
Calculate the orthodromic distance in meters between 2 geographic coordinates
pub fn approx(&self) -> Approx
[src]
Returns a proxy object allowing to compute approximate distances for cheap computation.
Example
let v: Vec<Coord> = get_coords(); let from = Coord { lon: 2.37715, lat: 48.846_781 }; let approx = from.approx(); for coord in &v { println!("distance({:?}, {:?}) = {}", from, coord, approx.sq_distance_to(coord).sqrt()); }
Trait Implementations
impl Clone for Coord
[src]
impl Copy for Coord
[src]
impl Debug for Coord
[src]
impl Default for Coord
[src]
impl<'de> Deserialize<'de> for Coord
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<(String, String)> for Coord
[src]
impl From<Coord> for (String, String)
[src]
impl From<Point<f64>> for Coord
[src]
impl Into<Point<f64>> for Coord
[src]
impl PartialEq<Coord> for Coord
[src]
impl Serialize for Coord
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Coord
[src]
Auto Trait Implementations
impl RefUnwindSafe for Coord
impl Send for Coord
impl Sync for Coord
impl Unpin for Coord
impl UnwindSafe for Coord
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,