pub struct Vector {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
A vector in 3D space representing magnitude and direction.
Vectors are represented as displacement from the origin, where the magnitude is the Euclidean distance and the direction points toward the coordinates.
§Example
use harmonica::Vector;
let v = Vector::new(1.0, 2.0, 3.0);
let scaled = v * 2.0;
assert_eq!(scaled.x, 2.0);Fields§
§x: f64X component.
y: f64Y component.
z: f64Z component.
Implementations§
Trait Implementations§
Source§impl AddAssign<Vector> for Point
impl AddAssign<Vector> for Point
Source§fn add_assign(&mut self, v: Vector)
fn add_assign(&mut self, v: Vector)
Performs the
+= operation. Read moreSource§impl AddAssign for Vector
impl AddAssign for Vector
Source§fn add_assign(&mut self, other: Vector)
fn add_assign(&mut self, other: Vector)
Performs the
+= operation. Read moreimpl Copy for Vector
impl StructuralPartialEq for Vector
Auto Trait Implementations§
impl Freeze for Vector
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
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