Struct Vec2d

Source
pub struct Vec2d { /* private fields */ }

Implementations§

Source§

impl Vec2d

Source

pub fn new(x: f64, y: f64) -> Self

Source

pub fn one() -> Self

Source

pub fn zero() -> Self

Source§

impl Vec2d

Source

pub fn floor(self) -> Self

Source

pub fn ceil(self) -> Self

Source

pub fn round(self) -> Self

Source

pub fn trunc(self) -> Self

Source

pub fn fract(self) -> Self

Source

pub fn abs(self) -> Self

Source

pub fn signum(self) -> Self

Source

pub fn powf(self, n: f64) -> Self

Source

pub fn sqrt(self) -> Self

Source

pub fn exp(self) -> Self

Source

pub fn exp2(self) -> Self

Source

pub fn ln(self) -> Self

Source

pub fn log(self, base: f64) -> Self

Source

pub fn log2(self) -> Self

Source

pub fn log10(self) -> Self

Source

pub fn cbrt(self) -> Self

Source

pub fn sin(self) -> Self

Source

pub fn cos(self) -> Self

Source

pub fn tan(self) -> Self

Source

pub fn sin_cos(self) -> (Self, Self)

Source

pub fn lerp(self, rhs: Self, s: f64) -> Self

Source

pub fn lerp_vec(self, rhs: Self, s: Self) -> Self

Source

pub fn is_nan(self) -> bool

Source

pub fn is_infinite(self) -> bool

Source

pub fn is_finite(self) -> bool

Source

pub fn recip(self) -> Self

Source

pub fn max(self, rhs: Self) -> Self

Source

pub fn min(self, rhs: Self) -> Self

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Source

pub fn saturate(self) -> Self

Source

pub fn min_element(self) -> f64

Source

pub fn max_element(self) -> f64

Source§

impl Vec2d

Source

pub fn dot(self, rhs: Self) -> f64

Source

pub fn cross(self, rhs: Self) -> f64

Source

pub fn length(self) -> f64

Source

pub fn length_squared(self) -> f64

Source

pub fn length_recip(self) -> f64

Source

pub fn distance(self, rhs: Self) -> f64

Source

pub fn distance_squared(self, rhs: Self) -> f64

Source

pub fn normalize(self) -> Self

Source

pub fn try_normalize(self) -> Option<Self>

Source

pub fn normalize_or_zero(self) -> Self

Source

pub fn is_normalized(self) -> bool

Source

pub fn angle_between(self, rhs: Self) -> f64

Source§

impl Vec2d

Source

pub fn to_array(self) -> [f64; 2]

Source

pub fn to_tuple(self) -> (f64, f64)

Source

pub fn to_vec2f(self) -> Vec2f

Source§

impl Vec2d

Source

pub fn x(self) -> f64

Source

pub fn y(self) -> f64

Source

pub fn xx(self) -> Self

Source

pub fn xy(self) -> Self

Source

pub fn yx(self) -> Self

Source

pub fn yy(self) -> Self

Source

pub fn xxx(self) -> Vec3d

Source

pub fn xxy(self) -> Vec3d

Source

pub fn xyx(self) -> Vec3d

Source

pub fn xyy(self) -> Vec3d

Source

pub fn yxx(self) -> Vec3d

Source

pub fn yxy(self) -> Vec3d

Source

pub fn yyx(self) -> Vec3d

Source

pub fn yyy(self) -> Vec3d

Source

pub fn xxxx(self) -> Vec4d

Source

pub fn xxxy(self) -> Vec4d

Source

pub fn xxyx(self) -> Vec4d

Source

pub fn xxyy(self) -> Vec4d

Source

pub fn yxxx(self) -> Vec4d

Source

pub fn yxxy(self) -> Vec4d

Source

pub fn yxyx(self) -> Vec4d

Source

pub fn yxyy(self) -> Vec4d

Trait Implementations§

Source§

impl Add<Vec2d> for f64

Source§

type Output = Vec2d

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vec2d) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vec2d) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<f64> for Vec2d

Source§

fn add_assign(&mut self, rhs: f64)

Performs the += operation. Read more
Source§

impl AddAssign for Vec2d

Source§

fn add_assign(&mut self, rhs: Vec2d)

Performs the += operation. Read more
Source§

impl Clone for Vec2d

Source§

fn clone(&self) -> Vec2d

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Vec2d

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Vec2d

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Vec2d

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<Vec2d> for f64

Source§

type Output = Vec2d

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Vec2d) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Vec2d) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f64> for Vec2d

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl DivAssign for Vec2d

Source§

fn div_assign(&mut self, rhs: Vec2d)

Performs the /= operation. Read more
Source§

impl From<(f64, f64)> for Vec2d

Source§

fn from(v: (f64, f64)) -> Self

Converts to this type from the input type.
Source§

impl From<Vec3d> for Vec2d

Source§

fn from(v: Vec3d) -> Self

Converts to this type from the input type.
Source§

impl From<Vec4d> for Vec2d

Source§

fn from(v: Vec4d) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Vec2d

Source§

fn from(v: f64) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Vec2d

Source§

type Output = f64

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for Vec2d

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Mul<Vec2d> for Mat2d

Source§

type Output = Vec2d

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec2d) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vec2d> for f64

Source§

type Output = Vec2d

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec2d) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec2d) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<f64> for Vec2d

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for Vec2d

Source§

fn mul_assign(&mut self, rhs: Vec2d)

Performs the *= operation. Read more
Source§

impl Neg for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Vec2d

Source§

fn eq(&self, other: &Vec2d) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub<Vec2d> for f64

Source§

type Output = Vec2d

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vec2d) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Vec2d

Source§

type Output = Vec2d

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vec2d) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<f64> for Vec2d

Source§

fn sub_assign(&mut self, rhs: f64)

Performs the -= operation. Read more
Source§

impl SubAssign for Vec2d

Source§

fn sub_assign(&mut self, rhs: Vec2d)

Performs the -= operation. Read more
Source§

impl Copy for Vec2d

Source§

impl StructuralPartialEq for Vec2d

Auto Trait Implementations§

§

impl Freeze for Vec2d

§

impl RefUnwindSafe for Vec2d

§

impl Send for Vec2d

§

impl Sync for Vec2d

§

impl Unpin for Vec2d

§

impl UnwindSafe for Vec2d

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.