pub trait FloatingVector2: Vector2where
    Self::Scalar: FloatingScalar,
{ fn from_angle(radians: Self::Scalar) -> Self { ... } fn dist(self, to: Self) -> Self::Scalar { ... } fn squared_dist(self, to: Self) -> Self::Scalar { ... } fn mag(self) -> Self::Scalar { ... } fn squared_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>
, { ... } fn project(self, other: Self) -> Self { ... } }
Expand description

Trait for manipulating floating-point 2D vectors

Provided Methods§

Create a new unit vector from the given angle in radians

Get the distance between this vector and another

Get the squared distance between this vector and another

Get the vector’s magnitude

Get the vector’s squared magnitude

Get the unit vector

Rotate the vector some number of radians about the origin

Rotate the vector some number of radians about a pivot

Linear interpolate the vector with another

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

Apply a transform to the vector

Project this vector onto another

Implementors§