Struct axgeom::Vec2
[−]
[src]
#[must_use]pub struct Vec2 { /* fields omitted */ }
A 2d point made up of f32's with a way to get the value on a particular axis easily.
Methods
impl Vec2
[src]
fn new(x: f32, y: f32) -> Vec2
[src]
fn set(&mut self, x: f32, y: f32)
[src]
fn get_axis_mut<'a>(&'a mut self, a: Axis) -> &'a mut f32
[src]
fn get_axis(&self, a: Axis) -> &f32
[src]
fn get(&self) -> (&f32, &f32)
[src]
fn get_mut(&mut self) -> (&mut f32, &mut f32)
[src]
fn inner_product(&self, b: &Vec2) -> f32
[src]
Calculates the dot product.
fn truncate(&mut self, nlen: f32)
[src]
Force the length of the vec to of max length nlen. If the length of the vec is zero, this will panic.
fn rotate90(&self) -> Vec2
[src]
fn rotate_by(&self, b: Vec2) -> Vec2
[src]
fn len(&self) -> f32
[src]
Calculates len using sqrt().
fn len_sqr(&self) -> f32
[src]
Trait Implementations
impl Copy for Vec2
[src]
impl Clone for Vec2
[src]
fn clone(&self) -> Vec2
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Vec2
[src]
impl Add for Vec2
[src]
type Output = Vec2
The resulting type after applying the +
operator.
fn add(self, other: Vec2) -> Vec2
[src]
Performs the +
operation.
impl Mul<f32> for Vec2
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, other: f32) -> Vec2
[src]
Performs the *
operation.
impl Div<f32> for Vec2
[src]
type Output = Vec2
The resulting type after applying the /
operator.
fn div(self, other: f32) -> Vec2
[src]
Performs the /
operation.
impl Neg for Vec2
[src]
type Output = Vec2
The resulting type after applying the -
operator.
fn neg(self) -> Vec2
[src]
Performs the unary -
operation.
impl MulAssign<f32> for Vec2
[src]
fn mul_assign(&mut self, rhs: f32)
[src]
Performs the *=
operation.
impl AddAssign for Vec2
[src]
fn add_assign(&mut self, rhs: Vec2)
[src]
Performs the +=
operation.