pub struct Vector {
pub x: f64,
pub y: f64,
}Expand description
Cartesian Vector in R2
Fields§
§x: f64§y: f64Implementations§
Trait Implementations§
Source§impl VectorTrait for Vector
impl VectorTrait for Vector
Source§type WedgeProductOutput = Bivector
type WedgeProductOutput = Bivector
Output type for wedge product
Needs to act as bivector
Source§type CrossProductOutput = f64
type CrossProductOutput = f64
Output type for cross product
Source§fn normalize(&self) -> Vector
fn normalize(&self) -> Vector
returns the norm of the vector, i.e scale the vector to length 1
Source§fn is_colinear_to(&self, rhs: Self) -> bool
fn is_colinear_to(&self, rhs: Self) -> bool
checks if vector is colinear with other vector
Source§fn wedge_product(&self, rhs: Self) -> Self::WedgeProductOutput
fn wedge_product(&self, rhs: Self) -> Self::WedgeProductOutput
Returns the wedge product of vector with other vector
Source§fn cross_product(&self, rhs: Self) -> Self::CrossProductOutput
fn cross_product(&self, rhs: Self) -> Self::CrossProductOutput
Returns cross product of self with other vector
Source§fn dot_product(&self, rhs: Self) -> f64
fn dot_product(&self, rhs: Self) -> f64
Returns dot product of self with other vector
impl 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