Struct cgmath::Vector2
[−]
[src]
pub struct Vector2<S> { pub x: S, pub y: S, }
Fields
x | |
y |
Methods
impl<S> Vector2<S>
impl<S: Copy + Neg<Output=S>> Vector2<S>
fn neg_self(&mut self)
Negate this vector in-place (multiply by -1).
impl<S: NumCast + Copy> Vector2<S>
impl<S: BaseNum> Vector2<S>
Operations specific to numeric two-dimensional vectors.
fn unit_x() -> Vector2<S>
A unit vector in the x
direction.
fn unit_y() -> Vector2<S>
A unit vector in the y
direction.
fn perp_dot(&self, other: &Vector2<S>) -> S
The perpendicular dot product of the vector and other
.
fn extend(&self, z: S) -> Vector3<S>
Create a Vector3
, using the x
and y
values from this vector, and the
provided z
.