pub struct XtEnu {
pub origin: LngLat,
}Expand description
East-North-Up (ENU) planar projection distance calculation.
Projects coordinates to a local East-North-Up coordinate system around the specified origin point, then calculates Euclidean distance. This provides better performance than great circle calculations while maintaining reasonable accuracy for regional datasets.
§Examples
use rapidgeo_distance::LngLat;
use rapidgeo_simplify::xt::{PerpDistance, XtEnu};
let origin = LngLat::new_deg(-121.5, 37.0); // Midpoint
let backend = XtEnu { origin };
let distance = backend.d_perp_m(
LngLat::new_deg(-122.0, 37.0),
LngLat::new_deg(-121.0, 37.0),
LngLat::new_deg(-121.5, 37.1), // 0.1 degree north
);
// Should be close to great circle result for this regional example
assert!(distance > 10000.0 && distance < 12000.0);Fields§
§origin: LngLatOrigin point for the ENU projection. Usually set to the midpoint of the polyline being simplified for optimal accuracy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XtEnu
impl RefUnwindSafe for XtEnu
impl Send for XtEnu
impl Sync for XtEnu
impl Unpin for XtEnu
impl UnwindSafe for XtEnu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more