Struct geomath::vector::Vector2[][src]

pub struct Vector2 {
    pub x: f64,
    pub y: f64,
}
Expand description

2D vectors (x, y)

Fields

x: f64y: f64

Implementations

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Area of the parallelepiped formed by two vectors, non-oriented

Cosine of the angle between the two vectors, non-oriented

Sine of the angle between the two vectors, non-oriented

Angle between two vectors, non-oriented

Convert the object to array

Set the object from array

The resulting type after applying the | operator.

Performs the | operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Get a inhomogeneous vector from an homogeneous vector Read more

Get a vector transformed to an homogeneous vector Read more

Object filled with zeros

Object filled with ones

Set the linear interpolation

Set the Hermite’s interpolation

Set the Bezier’s interpolation

Get linear interpolation

Get cubic Hermite’s interpolation, ie. with two tangent values

Get cubic Bezier’s interpolation, ie. with two control points

Dot product of the two objects

Squared magnitude of an object

Magnitude of an object

Squared distance between the two objects

Distance between the two objects

Normalizes the vector, ie. sets magnitude to 1 without changing direction

Get the normalized vector, ie. vector with same direction and magnitude 1

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

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

This method tests for !=.

Get a vector from polar coordinates

Set a vector from polar coordinates

Get a unit polar radial vector from angle

Get a unit tangent/prograde vector from angle

Get the rho coordinate

Get the phi coordinate

Set the rho coordinate

Set the phi coordinate

The resulting type after applying the % operator.

Performs the % operation. Read more

Fills an object with zeros

Fills a object with ones

Fills a object with a given value

Set a rigid body matrix from the given rotation matrix and translation vector

Get a rigid body matrix from rotation matrix and translation vector

Set a similarity matrix from scale factor, rotation matrix and translation vector

Get a similarity matrix from scale factor, rotation matrix and translation vector

Get the two parts of the split object

Concatenates two part to construct an object

Get the first part of the object

Get the second part of the object

Set the first part of the object

Set the second part of the object

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Set a translation matrix from translation vector

Get a translation matrix from translation vector

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.