Struct radiant_rs::Vec2 [] [src]

pub struct Vec2<T: Copy + Display + Float>(pub T, pub T);

A 2-dimensional vector.

Methods

impl<T: Copy + Display + Float> Vec2<T>
[src]

Creates a new instances.

Returns the length of the vector

Returns the direction of the vector in radians.

Returns the direction of the vector in degrees.

Creates a unit-vector from the angle given in radians.

Creates a unit-vector from the angle given in degrees.

Trait Implementations

impl<T: Copy + Copy + Display + Float> Copy for Vec2<T>
[src]

impl<T: Clone + Copy + Display + Float> Clone for Vec2<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug + Copy + Display + Float> Debug for Vec2<T>
[src]

Formats the value using the given formatter.

impl<T: Copy + Display + Float> VecType<T> for Vec2<T>
[src]

impl<T: Copy + Display + Float> Neg for Vec2<T>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<T: Copy + Display + Float> Add for Vec2<T>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<T: Copy + Display + Float> Mul<T> for Vec2<T>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<T: Copy + Display + Float> Display for Vec2<T>
[src]

Formats the value using the given formatter.