Skip to main content

Vector2D

Trait Vector2D 

Source
pub trait Vector2D<T: FloatIsh>:
    Default
    + Copy
    + Clone
    + PartialEq
    + PartialOrd {
    // Required methods
    fn vx(&self) -> T;
    fn vy(&self) -> T;
    fn magnitude(&self) -> T;
    fn normalize(&self) -> Self;
    fn dot(&self, other: &Self) -> T;
    fn angle(&self, other: &Self) -> Angle;
    fn perpendicular(&self) -> Self;
    fn rotate(&self, angle: Angle) -> Self;
    fn abs(&self) -> Self;
    fn to_point(&self) -> Point<T>;
}

Required Methods§

Source

fn vx(&self) -> T

Source

fn vy(&self) -> T

Source

fn magnitude(&self) -> T

Source

fn normalize(&self) -> Self

Source

fn dot(&self, other: &Self) -> T

Source

fn angle(&self, other: &Self) -> Angle

Source

fn perpendicular(&self) -> Self

Source

fn rotate(&self, angle: Angle) -> Self

Source

fn abs(&self) -> Self

Source

fn to_point(&self) -> Point<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: FloatIsh> Vector2D<T> for Vector<T>