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]

Compute the 2-norm squared, used for checking the total speed

Scale both vector elements linearly

Trait Implementations

impl Clone for Vector
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Vector
[src]

impl Debug for Vector
[src]

Formats the value using the given formatter.

impl PartialEq for Vector
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Add for Vector
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub for Vector
[src]

The resulting type after applying the - operator

The method for the - operator