pub struct CoordinateSystem<S: Scalar> { /* private fields */ }Expand description
A local coordinate system: an origin point plus 3 linearly independent
(not necessarily orthogonal or unit-length) basis vectors u, v, w,
letting a caller convert a point’s coordinates between this frame
(uvw space, relative to origin) and the ambient xyz space it was
itself expressed in.
Implementations§
Source§impl<S: Scalar> CoordinateSystem<S>
impl<S: Scalar> CoordinateSystem<S>
Sourcepub fn try_new(
origin: Vector3<S>,
u: Vector3<S>,
v: Vector3<S>,
w: Vector3<S>,
) -> GeopResult<Self>
pub fn try_new( origin: Vector3<S>, u: Vector3<S>, v: Vector3<S>, w: Vector3<S>, ) -> GeopResult<Self>
Build the coordinate system from its origin and 3 basis vectors.
Fails if u, v, w could be linearly dependent (zero signed
volume u . (v × w)), since that basis can’t be inverted into a
reciprocal one.
pub fn origin(&self) -> &Vector3<S>
pub fn u(&self) -> &Vector3<S>
pub fn v(&self) -> &Vector3<S>
pub fn w(&self) -> &Vector3<S>
Sourcepub fn to_xyz(&self, p_uvw: &Vector3<S>) -> Vector3<S>
pub fn to_xyz(&self, p_uvw: &Vector3<S>) -> Vector3<S>
Convert a point expressed in this frame (uvw coordinates, relative
to origin) to ambient xyz space: origin + p_uvw[0] * u + p_uvw[1] * v + p_uvw[2] * w.
Trait Implementations§
Source§impl<S: Clone + Scalar> Clone for CoordinateSystem<S>
impl<S: Clone + Scalar> Clone for CoordinateSystem<S>
Source§fn clone(&self) -> CoordinateSystem<S>
fn clone(&self) -> CoordinateSystem<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> Freeze for CoordinateSystem<S>where
S: Freeze,
impl<S> RefUnwindSafe for CoordinateSystem<S>where
S: RefUnwindSafe,
impl<S> Send for CoordinateSystem<S>
impl<S> Sync for CoordinateSystem<S>
impl<S> Unpin for CoordinateSystem<S>where
S: Unpin,
impl<S> UnsafeUnpin for CoordinateSystem<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for CoordinateSystem<S>where
S: 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