pub struct VectorPoint<M = Map<String, ValueType>>where
M: MValueCompatible,{
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: f64X coordinate
y: f64Y 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
impl VectorPoint
Source§impl<M> VectorPoint<M>where
M: MValueCompatible,
impl<M> VectorPoint<M>where
M: MValueCompatible,
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>(&self, other: &VectorPoint<M2>) -> f64where
M2: MValueCompatible,
pub fn distance<M2>(&self, other: &VectorPoint<M2>) -> f64where
M2: MValueCompatible,
Calculate the distance between two points, allowing different M types
Sourcepub fn modulo(self, modulus: f64) -> VectorPoint<M>
pub fn modulo(self, modulus: f64) -> VectorPoint<M>
Apply modular arithmetic to x, y, and z using modulus
Trait Implementations§
Source§impl<M1, M2> Add<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
impl<M1, M2> Add<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
+ operator.Source§fn add(
self,
other: VectorPoint<M2>,
) -> <VectorPoint<M1> as Add<VectorPoint<M2>>>::Output
fn add( self, other: VectorPoint<M2>, ) -> <VectorPoint<M1> as Add<VectorPoint<M2>>>::Output
Performs the
+ operation. Read moreSource§impl<M> Add<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Add<f64> for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> Clone for VectorPoint<M>where
M: Clone + MValueCompatible,
impl<M> Clone for VectorPoint<M>where
M: Clone + MValueCompatible,
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 for VectorPoint<M>where
M: Debug + MValueCompatible,
impl<M> Debug for VectorPoint<M>where
M: Debug + MValueCompatible,
Source§impl<M> Default for VectorPoint<M>where
M: Default + MValueCompatible,
impl<M> Default for VectorPoint<M>where
M: Default + MValueCompatible,
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: MValueCompatible + Deserialize<'de>,
impl<'de, M> Deserialize<'de> for VectorPoint<M>where
M: MValueCompatible + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VectorPoint<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VectorPoint<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<M1, M2> Div<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
impl<M1, M2> Div<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
/ operator.Source§fn div(
self,
other: VectorPoint<M2>,
) -> <VectorPoint<M1> as Div<VectorPoint<M2>>>::Output
fn div( self, other: VectorPoint<M2>, ) -> <VectorPoint<M1> as Div<VectorPoint<M2>>>::Output
Performs the
/ operation. Read moreSource§impl<M> Div<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Div<f64> for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> From<&Point> for VectorPoint<M>where
M: MValueCompatible,
impl<M> From<&Point> for VectorPoint<M>where
M: MValueCompatible,
Source§fn from(p: &Point) -> VectorPoint<M>
fn from(p: &Point) -> VectorPoint<M>
Converts to this type from the input type.
Source§impl<M> From<&Point3D> for VectorPoint<M>where
M: MValueCompatible,
impl<M> From<&Point3D> for VectorPoint<M>where
M: MValueCompatible,
Source§fn from(p: &Point3D) -> VectorPoint<M>
fn from(p: &Point3D) -> VectorPoint<M>
Converts to this type from the input type.
Source§impl<M> From<Point> for VectorPoint<M>where
M: MValueCompatible,
impl<M> From<Point> for VectorPoint<M>where
M: MValueCompatible,
Source§fn from(p: Point) -> VectorPoint<M>
fn from(p: Point) -> VectorPoint<M>
Converts to this type from the input type.
Source§impl<M> From<Point3D> for VectorPoint<M>where
M: MValueCompatible,
impl<M> From<Point3D> for VectorPoint<M>where
M: MValueCompatible,
Source§fn from(p: Point3D) -> VectorPoint<M>
fn from(p: Point3D) -> VectorPoint<M>
Converts to this type from the input type.
Source§impl<M1, M2> Mul<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
impl<M1, M2> Mul<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
* operator.Source§fn mul(
self,
other: VectorPoint<M2>,
) -> <VectorPoint<M1> as Mul<VectorPoint<M2>>>::Output
fn mul( self, other: VectorPoint<M2>, ) -> <VectorPoint<M1> as Mul<VectorPoint<M2>>>::Output
Performs the
* operation. Read moreSource§impl<M> Mul<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Mul<f64> for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> Neg for VectorPoint<M>where
M: MValueCompatible,
impl<M> Neg for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> Ord for VectorPoint<M>where
M: MValueCompatible,
impl<M> Ord for VectorPoint<M>where
M: MValueCompatible,
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> PartialEq for VectorPoint<M>where
M: MValueCompatible,
impl<M> PartialEq for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> PartialOrd for VectorPoint<M>where
M: MValueCompatible,
impl<M> PartialOrd for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> Rem<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Rem<f64> for VectorPoint<M>where
M: MValueCompatible,
Source§impl<M> RemAssign<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> RemAssign<f64> for VectorPoint<M>where
M: MValueCompatible,
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: MValueCompatible + Serialize,
impl<M> Serialize for VectorPoint<M>where
M: MValueCompatible + Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<M1, M2> Sub<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
impl<M1, M2> Sub<VectorPoint<M2>> for VectorPoint<M1>where
M1: MValueCompatible,
M2: MValueCompatible,
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
The resulting type after applying the
- operator.Source§fn sub(
self,
other: VectorPoint<M2>,
) -> <VectorPoint<M1> as Sub<VectorPoint<M2>>>::Output
fn sub( self, other: VectorPoint<M2>, ) -> <VectorPoint<M1> as Sub<VectorPoint<M2>>>::Output
Performs the
- operation. Read moreSource§impl<M> Sub<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Sub<f64> for VectorPoint<M>where
M: MValueCompatible,
impl<M> Eq for VectorPoint<M>where
M: MValueCompatible,
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