Struct ami::Vec2[][src]

pub struct Vec2 {
    pub x: f32,
    pub y: f32,
}

2-dimensional vector

Fields

X coordinate

Y coordinate

Methods

impl Vec2
[src]

Create a new Vec2

Create a zero Vec2

Calculate the dot product of two Vec2s

Get the magnitude of a Vec2

Normalize a Vec2

Calculate the distance squared between two Vec2

Calculate the distance between two Vec2

Find the midpoint between two Vec2

Create a left-hand perpendicular Vec2

Create a right-hand perpendicular Vec2

Calculate winding order for two Vec2.

The Vec2 should be initialized as edges pointing toward the same vertex. Returns true if the winding order is widdershins (counter-clockwise).

Calculate linear interpolation of two Vec2

Calculate angle between 2 Vec2's (on a plane they both lie on)

Trait Implementations

impl Clone for Vec2
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Vec2
[src]

impl PartialEq for Vec2
[src]

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

This method tests for !=.

impl Debug for Vec2
[src]

Formats the value using the given formatter. Read more

impl Add for Vec2
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub for Vec2
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Mul<f32> for Vec2
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul for Vec2
[src]

The resulting type after applying the * operator.

Calculate the cross product of two Vec2

impl Div<f32> for Vec2
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Neg for Vec2
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

Auto Trait Implementations

impl Send for Vec2

impl Sync for Vec2