pub struct UnitVector3 { /* private fields */ }Expand description
A finite, normalized direction in three-dimensional Cartesian space.
Construction accepts any finite non-zero vector and normalizes it with a scaled norm, avoiding intermediate overflow for large finite components.
Implementations§
Source§impl UnitVector3
impl UnitVector3
Sourcepub fn new(x: f64, y: f64, z: f64) -> Result<Self, InterferenceError>
pub fn new(x: f64, y: f64, z: f64) -> Result<Self, InterferenceError>
Checks and normalizes a direction.
Sourcepub fn components(self) -> [f64; 3]
pub fn components(self) -> [f64; 3]
Returns the normalized Cartesian components.
Sourcepub fn signed_distance_metres(self, from: Point3M, to: Point3M) -> f64
pub fn signed_distance_metres(self, from: Point3M, to: Point3M) -> f64
Projects the displacement from from to to onto this direction.
The result is a signed distance in metres. Propagation entry points reject a non-finite derived value and negative forward-plane distances.
Trait Implementations§
Source§impl Clone for UnitVector3
impl Clone for UnitVector3
Source§fn clone(&self) -> UnitVector3
fn clone(&self) -> UnitVector3
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 moreimpl Copy for UnitVector3
Source§impl Debug for UnitVector3
impl Debug for UnitVector3
Source§impl PartialEq for UnitVector3
impl PartialEq for UnitVector3
impl StructuralPartialEq for UnitVector3
Auto Trait Implementations§
impl Freeze for UnitVector3
impl RefUnwindSafe for UnitVector3
impl Send for UnitVector3
impl Sync for UnitVector3
impl Unpin for UnitVector3
impl UnsafeUnpin for UnitVector3
impl UnwindSafe for UnitVector3
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