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]

[src]

Create a new Vec2

[src]

Create a zero Vec2

[src]

Calculate the dot product of two Vec2s

[src]

Get the magnitude of a Vec2

[src]

Normalize a Vec2

[src]

Calculate the distance squared between two Vec2

[src]

Calculate the distance between two Vec2

[src]

Find the midpoint between two Vec2

[src]

Create a left-hand perpendicular Vec2

[src]

Create a right-hand perpendicular Vec2

[src]

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).

[src]

Calculate linear interpolation of two Vec2

[src]

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

Trait Implementations

impl Clone for Vec2
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Vec2
[src]

impl PartialEq for Vec2
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for Vec2
[src]

[src]

Formats the value using the given formatter. Read more

impl Add for Vec2
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub for Vec2
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Mul<f32> for Vec2
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul for Vec2
[src]

The resulting type after applying the * operator.

[src]

Calculate the cross product of two Vec2

impl Div<f32> for Vec2
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Neg for Vec2
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

Auto Trait Implementations

impl Send for Vec2

impl Sync for Vec2