Struct euler::DVec2 [−][src]
Double-precision 2D vector.
Fields
x: f64
y: f64
Methods
impl DVec2
[src]
impl DVec2
pub fn new(x: f64, y: f64) -> Self
[src]
pub fn new(x: f64, y: f64) -> Self
Full constructor.
pub fn zero() -> Self
[src]
pub fn zero() -> Self
Zero constructor.
impl DVec2
[src]
impl DVec2
pub fn dot(self, rhs: DVec2) -> f64
[src]
pub fn dot(self, rhs: DVec2) -> f64
Returns the dot product of two vectors.
pub fn length(self) -> f64
[src]
pub fn length(self) -> f64
Returns the length (magnitude) of the vector.
pub fn squared_length(self) -> f64
[src]
pub fn squared_length(self) -> f64
Returns the squared length of the vector.
pub fn normalize(self) -> DVec2
[src]
pub fn normalize(self) -> DVec2
impl DVec2
[src]
impl DVec2
Trait Implementations
impl Mul<DVec2> for DMat2
[src]
impl Mul<DVec2> for DMat2
type Output = DVec2
The resulting type after applying the *
operator.
fn mul(self, rhs: DVec2) -> Self::Output
[src]
fn mul(self, rhs: DVec2) -> Self::Output
Performs the *
operation.
impl<'a> Mul<DVec2> for &'a DMat2
[src]
impl<'a> Mul<DVec2> for &'a DMat2
type Output = DVec2
The resulting type after applying the *
operator.
fn mul(self, rhs: DVec2) -> Self::Output
[src]
fn mul(self, rhs: DVec2) -> Self::Output
Performs the *
operation.
impl From<DVec2> for Vec2
[src]
impl From<DVec2> for Vec2
impl Clone for DVec2
[src]
impl Clone for DVec2
fn clone(&self) -> DVec2
[src]
fn clone(&self) -> DVec2
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for DVec2
[src]
impl Copy for DVec2
impl Debug for DVec2
[src]
impl Debug for DVec2
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for DVec2
[src]
impl Default for DVec2
impl PartialEq for DVec2
[src]
impl PartialEq for DVec2
fn eq(&self, other: &DVec2) -> bool
[src]
fn eq(&self, other: &DVec2) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DVec2) -> bool
[src]
fn ne(&self, other: &DVec2) -> bool
This method tests for !=
.
impl From<f32> for DVec2
[src]
impl From<f32> for DVec2
impl From<f64> for DVec2
[src]
impl From<f64> for DVec2
impl From<Vec2> for DVec2
[src]
impl From<Vec2> for DVec2
impl Display for DVec2
[src]
impl Display for DVec2
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Add<DVec2> for DVec2
[src]
impl Add<DVec2> for DVec2
type Output = DVec2
The resulting type after applying the +
operator.
fn add(self, rhs: DVec2) -> Self::Output
[src]
fn add(self, rhs: DVec2) -> Self::Output
Performs the +
operation.
impl AddAssign<DVec2> for DVec2
[src]
impl AddAssign<DVec2> for DVec2
fn add_assign(&mut self, rhs: DVec2)
[src]
fn add_assign(&mut self, rhs: DVec2)
Performs the +=
operation.
impl Sub<DVec2> for DVec2
[src]
impl Sub<DVec2> for DVec2
type Output = DVec2
The resulting type after applying the -
operator.
fn sub(self, rhs: DVec2) -> Self::Output
[src]
fn sub(self, rhs: DVec2) -> Self::Output
Performs the -
operation.
impl SubAssign<DVec2> for DVec2
[src]
impl SubAssign<DVec2> for DVec2
fn sub_assign(&mut self, rhs: DVec2)
[src]
fn sub_assign(&mut self, rhs: DVec2)
Performs the -=
operation.
impl Mul<DVec2> for f64
[src]
impl Mul<DVec2> for f64
type Output = DVec2
The resulting type after applying the *
operator.
fn mul(self, arg: DVec2) -> Self::Output
[src]
fn mul(self, arg: DVec2) -> Self::Output
Performs the *
operation.
impl Mul<f64> for DVec2
[src]
impl Mul<f64> for DVec2
type Output = DVec2
The resulting type after applying the *
operator.
fn mul(self, arg: f64) -> Self::Output
[src]
fn mul(self, arg: f64) -> Self::Output
Performs the *
operation.
impl MulAssign<f64> for DVec2
[src]
impl MulAssign<f64> for DVec2
fn mul_assign(&mut self, rhs: f64)
[src]
fn mul_assign(&mut self, rhs: f64)
Performs the *=
operation.
impl Div<f64> for DVec2
[src]
impl Div<f64> for DVec2
type Output = DVec2
The resulting type after applying the /
operator.
fn div(self, arg: f64) -> Self::Output
[src]
fn div(self, arg: f64) -> Self::Output
Performs the /
operation.
impl DivAssign<f64> for DVec2
[src]
impl DivAssign<f64> for DVec2
fn div_assign(&mut self, rhs: f64)
[src]
fn div_assign(&mut self, rhs: f64)
Performs the /=
operation.
impl AsRef<[f64; 2]> for DVec2
[src]
impl AsRef<[f64; 2]> for DVec2
impl From<[f64; 2]> for DVec2
[src]
impl From<[f64; 2]> for DVec2
impl Into<[f64; 2]> for DVec2
[src]
impl Into<[f64; 2]> for DVec2
impl ApproxEq for DVec2
[src]
impl ApproxEq for DVec2
type Epsilon = <Vector2<f64> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> Self::Epsilon
[src]
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.