pub struct Point3M { /* private fields */ }Expand description
A point in three-dimensional Cartesian space measured in metres.
Each coordinate is a Metres, so a Point3M cannot contain NaN or an
infinity.
Implementations§
Source§impl Point3M
impl Point3M
Sourcepub fn new(x: Metres, y: Metres, z: Metres) -> Self
pub fn new(x: Metres, y: Metres, z: Metres) -> Self
Constructs a point from already checked coordinates.
Sourcepub fn from_metres(x: f64, y: f64, z: f64) -> Result<Self, InterferenceError>
pub fn from_metres(x: f64, y: f64, z: f64) -> Result<Self, InterferenceError>
Checks three raw coordinates and constructs a point.
Sourcepub fn coordinates_metres(self) -> [f64; 3]
pub fn coordinates_metres(self) -> [f64; 3]
Returns the Cartesian coordinates as metres.
Sourcepub fn distance_to(self, other: Self) -> f64
pub fn distance_to(self, other: Self) -> f64
Returns the Euclidean distance to another point in metres.
Extremely separated finite coordinates can have a distance beyond the
finite f64 range. Propagation entry points reject that derived value.
Trait Implementations§
impl Copy for Point3M
impl StructuralPartialEq for Point3M
Auto Trait Implementations§
impl Freeze for Point3M
impl RefUnwindSafe for Point3M
impl Send for Point3M
impl Sync for Point3M
impl Unpin for Point3M
impl UnsafeUnpin for Point3M
impl UnwindSafe for Point3M
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