Struct euler::Vec2[][src]

#[repr(C)]
pub struct Vec2 { pub x: f32, pub y: f32, }

Single-precision 2D vector.

Fields

Methods

impl Vec2
[src]

Full constructor.

Zero constructor.

impl Vec2
[src]

Returns the dot product of two vectors.

Returns the length (magnitude) of the vector.

Returns the squared length of the vector.

Scales the vector to unit length.

Panics

Panics if the vector is zero.

impl Vec2
[src]

Returns the acute angle between two vectors.

Panics

Panics if self is the zero vector.

Trait Implementations

impl Mul<Vec2> for Mat2
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<Vec2> for &'a Mat2
[src]

The resulting type after applying the * operator.

Performs the * operation.

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 Debug for Vec2
[src]

Formats the value using the given formatter. Read more

impl Default for Vec2
[src]

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

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 From<f32> for Vec2
[src]

Performs the conversion.

impl From<f64> for Vec2
[src]

Performs the conversion.

impl From<DVec2> for Vec2
[src]

Performs the conversion.

impl Display for Vec2
[src]

Formats the value using the given formatter. Read more

impl From<Vec2> for DVec2
[src]

Performs the conversion.

impl Add<Vec2> for Vec2
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<Vec2> for Vec2
[src]

Performs the += operation.

impl Sub<Vec2> for Vec2
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<Vec2> for Vec2
[src]

Performs the -= operation.

impl Mul<Vec2> for f32
[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 MulAssign<f32> for Vec2
[src]

Performs the *= operation.

impl Div<f32> for Vec2
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl DivAssign<f32> for Vec2
[src]

Performs the /= operation.

impl AsRef<[f32; 2]> for Vec2
[src]

Performs the conversion.

impl From<[f32; 2]> for Vec2
[src]

Performs the conversion.

impl Into<[f32; 2]> for Vec2
[src]

Performs the conversion.

impl ApproxEq for Vec2
[src]

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

The default relative tolerance for testing values that are far-apart. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

Auto Trait Implementations

impl Send for Vec2

impl Sync for Vec2