Struct mold2d::vector::Vector2D
[−]
[src]
pub struct Vector2D { pub x: f64, pub y: f64, }
A two-dimensional vector
Fields
x: f64
y: f64
Methods
impl Vector2D
[src]
fn len(&self) -> f64
Returns the length of a vector
fn normalize(&self) -> Vector2D
Returns a normalized vector
Trait Implementations
impl Clone for Vector2D
[src]
fn clone(&self) -> Vector2D
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Vector2D
[src]
impl Debug for Vector2D
[src]
impl PartialEq for Vector2D
[src]
fn eq(&self, __arg_0: &Vector2D) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector2D) -> bool
This method tests for !=
.
impl Add<Vector2D> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the +
operator
fn add(self, other: Vector2D) -> Vector2D
The method for the +
operator
impl Add<f64> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the +
operator
fn add(self, other: f64) -> Vector2D
The method for the +
operator
impl Sub<Vector2D> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the -
operator
fn sub(self, other: Vector2D) -> Vector2D
The method for the -
operator
impl Sub<f64> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the -
operator
fn sub(self, other: f64) -> Vector2D
The method for the -
operator
impl Mul<Vector2D> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the *
operator
fn mul(self, other: Vector2D) -> Vector2D
The method for the *
operator
impl Mul<f64> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the *
operator
fn mul(self, other: f64) -> Vector2D
The method for the *
operator
impl Div<Vector2D> for Vector2D
[src]
type Output = Vector2D
The resulting type after applying the /
operator
fn div(self, other: Vector2D) -> Vector2D
The method for the /
operator