pub struct VectorPoint<M: MValueCompatible = MValue> {
pub x: f64,
pub y: f64,
pub z: Option<f64>,
pub m: Option<M>,
pub t: Option<f64>,
}
Expand description
A Vector Point uses a structure for 2D or 3D points
Fields§
§x: f64
X coordinate
y: f64
Y coordinate
z: Option<f64>
Z coordinate or “altitude”. May be None
m: Option<M>
M-Value
t: Option<f64>
T for tolerance. A tmp value used for simplification
Implementations§
Source§impl VectorPoint<MValue>
impl VectorPoint<MValue>
Source§impl<M: MValueCompatible> VectorPoint<M>
impl<M: MValueCompatible> VectorPoint<M>
Sourcepub fn project(&mut self, bbox: Option<&mut BBox3D>)
pub fn project(&mut self, bbox: Option<&mut BBox3D>)
Project the point into the 0->1 coordinate system
Sourcepub fn unproject(&mut self)
pub fn unproject(&mut self)
Unproject the point from the 0->1 coordinate system back to a lon-lat coordinate
Sourcepub fn distance<M2: MValueCompatible>(&self, other: &VectorPoint<M2>) -> f64
pub fn distance<M2: MValueCompatible>(&self, other: &VectorPoint<M2>) -> f64
Calculate the distance between two points, allowing different M types
Trait Implementations§
Source§impl<M1: MValueCompatible, M2: MValueCompatible> Add<VectorPoint<M2>> for VectorPoint<M1>
impl<M1: MValueCompatible, M2: MValueCompatible> Add<VectorPoint<M2>> for VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
+
operator.Source§impl<M: MValueCompatible> Add<f64> for VectorPoint<M>
impl<M: MValueCompatible> Add<f64> for VectorPoint<M>
Source§impl<M: Clone + MValueCompatible> Clone for VectorPoint<M>
impl<M: Clone + MValueCompatible> Clone for VectorPoint<M>
Source§fn clone(&self) -> VectorPoint<M>
fn clone(&self) -> VectorPoint<M>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<M: Debug + MValueCompatible> Debug for VectorPoint<M>
impl<M: Debug + MValueCompatible> Debug for VectorPoint<M>
Source§impl<M: Default + MValueCompatible> Default for VectorPoint<M>
impl<M: Default + MValueCompatible> Default for VectorPoint<M>
Source§fn default() -> VectorPoint<M>
fn default() -> VectorPoint<M>
Returns the “default value” for a type. Read more
Source§impl<'de, M> Deserialize<'de> for VectorPoint<M>where
M: Deserialize<'de> + MValueCompatible,
impl<'de, M> Deserialize<'de> for VectorPoint<M>where
M: Deserialize<'de> + MValueCompatible,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<M1: MValueCompatible, M2: MValueCompatible> Div<VectorPoint<M2>> for VectorPoint<M1>
impl<M1: MValueCompatible, M2: MValueCompatible> Div<VectorPoint<M2>> for VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
/
operator.Source§impl<M: MValueCompatible> Div<f64> for VectorPoint<M>
impl<M: MValueCompatible> Div<f64> for VectorPoint<M>
Source§impl<M: MValueCompatible> From<&Point> for VectorPoint<M>
impl<M: MValueCompatible> From<&Point> for VectorPoint<M>
Source§impl<M: MValueCompatible> From<&Point3D> for VectorPoint<M>
impl<M: MValueCompatible> From<&Point3D> for VectorPoint<M>
Source§impl<M: MValueCompatible> From<Point> for VectorPoint<M>
impl<M: MValueCompatible> From<Point> for VectorPoint<M>
Source§impl<M: MValueCompatible> From<Point3D> for VectorPoint<M>
impl<M: MValueCompatible> From<Point3D> for VectorPoint<M>
Source§impl<M1: MValueCompatible, M2: MValueCompatible> Mul<VectorPoint<M2>> for VectorPoint<M1>
impl<M1: MValueCompatible, M2: MValueCompatible> Mul<VectorPoint<M2>> for VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
*
operator.Source§impl<M: MValueCompatible> Mul<f64> for VectorPoint<M>
impl<M: MValueCompatible> Mul<f64> for VectorPoint<M>
Source§impl<M: MValueCompatible> Neg for VectorPoint<M>
impl<M: MValueCompatible> Neg for VectorPoint<M>
Source§impl<M: MValueCompatible> Ord for VectorPoint<M>
impl<M: MValueCompatible> Ord for VectorPoint<M>
Source§fn cmp(&self, other: &VectorPoint<M>) -> Ordering
fn cmp(&self, other: &VectorPoint<M>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<M: MValueCompatible> PartialEq for VectorPoint<M>
impl<M: MValueCompatible> PartialEq for VectorPoint<M>
Source§impl<M: MValueCompatible> PartialOrd for VectorPoint<M>
impl<M: MValueCompatible> PartialOrd for VectorPoint<M>
Source§impl<M: MValueCompatible> Rem<f64> for VectorPoint<M>
impl<M: MValueCompatible> Rem<f64> for VectorPoint<M>
Source§impl<M: MValueCompatible> RemAssign<f64> for VectorPoint<M>
impl<M: MValueCompatible> RemAssign<f64> for VectorPoint<M>
Source§fn rem_assign(&mut self, modulus: f64)
fn rem_assign(&mut self, modulus: f64)
Performs the
%=
operation. Read moreSource§impl<M> Serialize for VectorPoint<M>where
M: Serialize + MValueCompatible,
impl<M> Serialize for VectorPoint<M>where
M: Serialize + MValueCompatible,
Source§impl<M1: MValueCompatible, M2: MValueCompatible> Sub<VectorPoint<M2>> for VectorPoint<M1>
impl<M1: MValueCompatible, M2: MValueCompatible> Sub<VectorPoint<M2>> for VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
-
operator.Source§impl<M: MValueCompatible> Sub<f64> for VectorPoint<M>
impl<M: MValueCompatible> Sub<f64> for VectorPoint<M>
impl<M: MValueCompatible> Eq for VectorPoint<M>
Auto Trait Implementations§
impl<M> Freeze for VectorPoint<M>where
M: Freeze,
impl<M> RefUnwindSafe for VectorPoint<M>where
M: RefUnwindSafe,
impl<M> Send for VectorPoint<M>where
M: Send,
impl<M> Sync for VectorPoint<M>where
M: Sync,
impl<M> Unpin for VectorPoint<M>where
M: Unpin,
impl<M> UnwindSafe for VectorPoint<M>where
M: UnwindSafe,
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