Struct tile_net::Vector
[−]
[src]
pub struct Vector(pub f32, pub f32);
Describe a point in 2-space
Use two floats to denote the x and y coordinates respectively in the tuple.
use tile_net::Vector; let point = Vector(0.5, 1.0); assert_eq!(point.0, 0.5); assert_eq!(point.1, 1.0);
Methods
impl Vector
[src]
fn from_tuple(tuple: (f32, f32)) -> Vector
fn norm2sq(&self) -> f32
Compute the 2-norm squared, used for checking the total speed
fn scale(&mut self, factor: f32)
Scale both vector elements linearly
Trait Implementations
impl Clone for Vector
[src]
fn clone(&self) -> Vector
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 Vector
[src]
impl Debug for Vector
[src]
impl PartialEq for Vector
[src]
fn eq(&self, __arg_0: &Vector) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector) -> bool
This method tests for !=
.
impl Add for Vector
[src]
type Output = Vector
The resulting type after applying the +
operator
fn add(self, other: Vector) -> Vector
The method for the +
operator