Struct vodk_math::vec2::Vector2D [] [src]

pub struct Vector2D<Unit = Untyped> {
    pub x: f32,
    pub y: f32,
    // some fields omitted
}

Fields

Methods

impl<U> Vector2D<U>
[src]

Angle between vectors v1 and v2 (oriented clockwise assyming y points downwards). The result is a number between 0 and 2*PI.

ex: directed_angle([0,1], [1,0]) = 3/2 Pi rad x __ 0--> / \ y| | x--> v2 v \ |v1 v

Or, assuming y points upwards: directed_angle([0,-1], [1,0]) = 1/2 Pi rad

^ v2 y| x--> 0--> v1 | / x v-

Trait Implementations

impl<U> AsRef<[f32; 2]> for Vector2D<U>
[src]

Performs the conversion.

impl<U> AsRef<(f32, f32)> for Vector2D<U>
[src]

Performs the conversion.

impl<U> AsMut<[f32; 2]> for Vector2D<U>
[src]

Performs the conversion.

impl<U> AsMut<(f32, f32)> for Vector2D<U>
[src]

Performs the conversion.

impl<U> From<[f32; 2]> for Vector2D<U>
[src]

Performs the conversion.

impl<U> From<(f32, f32)> for Vector2D<U>
[src]

Performs the conversion.

impl<U> Default for Vector2D<U>
[src]

Returns the "default value" for a type. Read more

impl<U> Add<Vector2D<U>> for Vector2D<U>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<U> Sub<Vector2D<U>> for Vector2D<U>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<U> Mul<Vector2D<U>> for Vector2D<U>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<U> Mul<f32> for Vector2D<U>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<U> Div<Vector2D<U>> for Vector2D<U>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<U> Div<f32> for Vector2D<U>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<U> Neg for Vector2D<U>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<U: Unit> Debug for Vector2D<U>
[src]

Formats the value using the given formatter.

impl<U> Copy for Vector2D<U>
[src]

impl<U> Clone for Vector2D<U>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<U> PartialEq for Vector2D<U>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.