[][src]Trait vector2math::FloatingVector2

pub trait FloatingVector2: Vector2 where
    Self::Scalar: FloatingScalar
{ fn dist(self, to: Self) -> Self::Scalar { ... }
fn mag(self) -> Self::Scalar { ... }
fn unit(self) -> Self { ... }
fn rotate(self, radians: Self::Scalar) -> Self { ... }
fn rotate_about(self, radians: Self::Scalar, pivot: Self) -> Self { ... }
fn lerp(self, other: Self, t: Self::Scalar) -> Self { ... }
fn atan(self) -> Self::Scalar { ... }
fn transform<T>(self, transform: T) -> Self
    where
        T: Transform<Scalar = Self::Scalar>
, { ... } }

Trait for manipulating floating-point 2D vectors

Provided methods

fn dist(self, to: Self) -> Self::Scalar

Get the distance between this vector and another

fn mag(self) -> Self::Scalar

Get the vector's magnitude

fn unit(self) -> Self

Get the unit vector

fn rotate(self, radians: Self::Scalar) -> Self

Rotate the vector some number of radians about the origin

fn rotate_about(self, radians: Self::Scalar, pivot: Self) -> Self

Rotate the vector some number of radians about a pivot

fn lerp(self, other: Self, t: Self::Scalar) -> Self

Linear interpolate the vector with another

fn atan(self) -> Self::Scalar

Get the arctangent of the vector, which corresponds to the angle it represents bounded between -π to π

fn transform<T>(self, transform: T) -> Self where
    T: Transform<Scalar = Self::Scalar>, 

Apply a transform to the vector

Loading content...

Implementors

impl<T> FloatingVector2 for T where
    T: Vector2,
    T::Scalar: FloatingScalar
[src]

Loading content...