[−][src]Struct some_math_lib::Vector2
A 2-dimensional vector.
Fields
x: f64
y: f64
Implementations
impl Vector2
[src]
pub fn new(x: f64, y: f64) -> Self
[src]
Creates a new vector with components x
and y
.
pub fn squared_magnitude(&self) -> f64
[src]
Returns the squared magnitude of the vector.
pub fn magnitude(&self) -> f64
[src]
Returns the magnitude of the vector.
pub fn dot_product(&self, rhs: &Self) -> f64
[src]
Returns the dot product of self
and rhs
.
pub fn cross_product_magnitude(&self, rhs: &Self) -> f64
[src]
Returns the magnitude of the vector formed by the cross product of
self
and rhs
.
pub fn cross_product(&self, rhs: &Self) -> Vector3
[src]
Returns a Vector3
with an x
and y
of
0.0
and a z
of the computed magnitude.
Trait Implementations
impl Add<Vector2> for Vector2
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self::Output
[src]
impl Clone for Vector2
[src]
impl Copy for Vector2
[src]
impl Debug for Vector2
[src]
impl Div<f64> for Vector2
[src]
type Output = Self
The resulting type after applying the /
operator.
pub fn div(self, scalar: f64) -> Self::Output
[src]
impl Mul<f64> for Vector2
[src]
type Output = Self
The resulting type after applying the *
operator.
pub fn mul(self, scalar: f64) -> Self::Output
[src]
impl Sub<Vector2> for Vector2
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector2
impl Send for Vector2
impl Sync for Vector2
impl Unpin for Vector2
impl UnwindSafe for Vector2
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,