#[repr(C)]
pub struct Vector2 {
pub x: f32,
pub y: f32,
}
Expand description
Construct new a vector from individual coordinates
Construct new a vector where each coordinate is the same
The multiplicative identity
Compute the dot product between this vector and another
Linear interpolation between this vector and another
Compute a cross product between this vector and another.
This treats both inputs as 3D vectors with a z-component of zero,
performs the normal 3D cross product, and returns only the resulting z-component.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the - operator.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
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)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.