#[repr(C)]pub struct VectorPoint<M: Clone = 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: Clone> VectorPoint<M>
impl<M: Clone> VectorPoint<M>
Sourcepub fn to_m_value(&self) -> VectorPoint<MValue>
pub fn to_m_value(&self) -> VectorPoint<MValue>
Convert to an MValue VectorPoint
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 modulo(self, modulus: f64) -> Self
pub fn modulo(self, modulus: f64) -> Self
Apply modular arithmetic to x, y, and z using modulus
Sourcepub fn angle<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
pub fn angle<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
Returns the angle between “this” and v in radians, in the range [0, pi]. If either vector is zero-length, or nearly zero-length, the result will be zero, regardless of the other value.
Sourcepub fn cross<M2: Clone>(&self, b: &VectorPoint<M2>) -> Self
pub fn cross<M2: Clone>(&self, b: &VectorPoint<M2>) -> Self
Get the cross product of two Vector Points
Sourcepub fn dot<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
pub fn dot<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
dot returns the standard dot product of v and ov.
Sourcepub fn distance<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
pub fn distance<M2: Clone>(&self, b: &VectorPoint<M2>) -> f64
return the distance from this point to the other point in radians
Sourcepub fn largest_abs_component(&self) -> u8
pub fn largest_abs_component(&self) -> u8
Returns the largest absolute component of the point.
Sourcepub fn intermediate<M2: Clone>(&self, b: &VectorPoint<M2>, t: f64) -> Self
pub fn intermediate<M2: Clone>(&self, b: &VectorPoint<M2>, t: f64) -> Self
Returns the intermediate point between this and the other point.
Sourcepub fn perpendicular(&self) -> Self
pub fn perpendicular(&self) -> Self
Returns the perpendicular vector
Trait Implementations§
Source§impl<M1: Clone, M2: Clone> Add<&VectorPoint<M2>> for &VectorPoint<M1>
impl<M1: Clone, M2: Clone> Add<&VectorPoint<M2>> for &VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
+
operator.Source§impl<M1: Clone, M2: Clone> AddAssign<&VectorPoint<M2>> for VectorPoint<M1>
impl<M1: Clone, M2: Clone> AddAssign<&VectorPoint<M2>> for VectorPoint<M1>
Source§fn add_assign(&mut self, other: &VectorPoint<M2>)
fn add_assign(&mut self, other: &VectorPoint<M2>)
+=
operation. Read moreSource§impl<M: Clone> AddAssign<f64> for VectorPoint<M>
impl<M: Clone> AddAssign<f64> for VectorPoint<M>
Source§fn add_assign(&mut self, other: f64)
fn add_assign(&mut self, other: f64)
+=
operation. Read moreSource§impl<M: Clone + Clone> Clone for VectorPoint<M>
impl<M: Clone + Clone> Clone for VectorPoint<M>
Source§fn clone(&self) -> VectorPoint<M>
fn clone(&self) -> VectorPoint<M>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<M: Default + Clone> Default for VectorPoint<M>
impl<M: Default + Clone> Default for VectorPoint<M>
Source§fn default() -> VectorPoint<M>
fn default() -> VectorPoint<M>
Source§impl<'de, M> Deserialize<'de> for VectorPoint<M>where
M: Deserialize<'de> + Clone,
impl<'de, M> Deserialize<'de> for VectorPoint<M>where
M: Deserialize<'de> + Clone,
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>,
Source§impl<M1: Clone, M2: Clone> Div<&VectorPoint<M2>> for &VectorPoint<M1>
impl<M1: Clone, M2: Clone> Div<&VectorPoint<M2>> for &VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
/
operator.Source§impl<M1: Clone, M2: Clone> DivAssign<&VectorPoint<M2>> for VectorPoint<M1>
impl<M1: Clone, M2: Clone> DivAssign<&VectorPoint<M2>> for VectorPoint<M1>
Source§fn div_assign(&mut self, other: &VectorPoint<M2>)
fn div_assign(&mut self, other: &VectorPoint<M2>)
/=
operation. Read moreSource§impl<M: Clone> DivAssign<f64> for VectorPoint<M>
impl<M: Clone> DivAssign<f64> for VectorPoint<M>
Source§fn div_assign(&mut self, other: f64)
fn div_assign(&mut self, other: f64)
/=
operation. Read moreSource§impl<M: Clone> GetXY for VectorPoint<M>
impl<M: Clone> GetXY for VectorPoint<M>
Source§impl<M1: Clone, M2: Clone> Mul<&VectorPoint<M2>> for &VectorPoint<M1>
impl<M1: Clone, M2: Clone> Mul<&VectorPoint<M2>> for &VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
*
operator.Source§impl<M1: Clone, M2: Clone> MulAssign<&VectorPoint<M2>> for VectorPoint<M1>
impl<M1: Clone, M2: Clone> MulAssign<&VectorPoint<M2>> for VectorPoint<M1>
Source§fn mul_assign(&mut self, other: &VectorPoint<M2>)
fn mul_assign(&mut self, other: &VectorPoint<M2>)
*=
operation. Read moreSource§impl<M: Clone> MulAssign<f64> for VectorPoint<M>
impl<M: Clone> MulAssign<f64> for VectorPoint<M>
Source§fn mul_assign(&mut self, other: f64)
fn mul_assign(&mut self, other: f64)
*=
operation. Read moreSource§impl<M: Clone> Neg for &VectorPoint<M>
impl<M: Clone> Neg for &VectorPoint<M>
Source§impl<M: Clone> Ord for VectorPoint<M>
impl<M: Clone> 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,
Source§impl<M: Clone> PartialEq for VectorPoint<M>
impl<M: Clone> PartialEq for VectorPoint<M>
Source§impl<M: Clone> PartialOrd for VectorPoint<M>
impl<M: Clone> PartialOrd for VectorPoint<M>
Source§impl<M: Clone> RemAssign<f64> for VectorPoint<M>
impl<M: Clone> RemAssign<f64> for VectorPoint<M>
Source§fn rem_assign(&mut self, modulus: f64)
fn rem_assign(&mut self, modulus: f64)
%=
operation. Read moreSource§impl<M> Serialize for VectorPoint<M>
impl<M> Serialize for VectorPoint<M>
Source§impl<M1: Clone, M2: Clone> Sub<&VectorPoint<M2>> for &VectorPoint<M1>
impl<M1: Clone, M2: Clone> Sub<&VectorPoint<M2>> for &VectorPoint<M1>
Source§type Output = VectorPoint<M1>
type Output = VectorPoint<M1>
-
operator.Source§impl<M1: Clone, M2: Clone> SubAssign<&VectorPoint<M2>> for VectorPoint<M1>
impl<M1: Clone, M2: Clone> SubAssign<&VectorPoint<M2>> for VectorPoint<M1>
Source§fn sub_assign(&mut self, other: &VectorPoint<M2>)
fn sub_assign(&mut self, other: &VectorPoint<M2>)
-=
operation. Read moreSource§impl<M: Clone> SubAssign<f64> for VectorPoint<M>
impl<M: Clone> SubAssign<f64> for VectorPoint<M>
Source§fn sub_assign(&mut self, other: f64)
fn sub_assign(&mut self, other: f64)
-=
operation. Read more