Struct quicksilver::geom::Vector [] [src]

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

A 2D vector with an arbitrary numeric type

Fields

The x coordinate of the vector

The y coordinate of the vector

Methods

impl Vector
[src]

[src]

The zero vector

[src]

A vector with x = 1f32, y = 0f32

[src]

A vector with x = 0f32, y = 1f32

[src]

A vector with x = 1f32, y = 1f32

[src]

Create a new vector

[src]

Create a new vector with integer components

[src]

Create a unit vector at a given angle

[src]

Get the squared length of the vector (faster than getting the length)

[src]

Get the length of the vector

[src]

Clamp a vector somewhere between a minimum and a maximum

[src]

Get the cross product of a vector

[src]

Get the dot product of a vector

[src]

Normalize the vector's length from [0, 1]

[src]

Get only the X component of the Vector, represented as a vector

[src]

Get only the Y component of the Vector, represented as a vector

[src]

Get the vector equal to Vector(1 / x, 1 / y)

[src]

Multiply the components in the matching places

[src]

Get the angle a vector forms with the positive x-axis, counter clockwise

Trait Implementations

impl Copy for Vector
[src]

impl Clone for Vector
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Vector
[src]

[src]

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

impl Debug for Vector
[src]

[src]

Formats the value using the given formatter.

impl Neg for Vector
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl Add for Vector
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign for Vector
[src]

[src]

Performs the += operation.

impl Sub for Vector
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign for Vector
[src]

[src]

Performs the -= operation.

impl Div<f32> for Vector
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<f32> for Vector
[src]

[src]

Performs the /= operation.

impl Mul<f32> for Vector
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<f32> for Vector
[src]

[src]

Performs the *= operation.

impl Div<i32> for Vector
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<i32> for Vector
[src]

[src]

Performs the /= operation.

impl Mul<i32> for Vector
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<i32> for Vector
[src]

[src]

Performs the *= operation.

impl PartialEq for Vector
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl Eq for Vector
[src]

impl Display for Vector
[src]

[src]

Formats the value using the given formatter. Read more

impl Rand for Vector
[src]

[src]

Generates a random instance of this type using the specified source of randomness. Read more