[][src]Type Definition tokyo::geom::Vector

type Vector = Vector2D<f32>;

A vector inside the game arena, in terms of pixels. It's mostly used to represent a velocity. See euclid documentation for its API, but you can assume all the basic linear algebra operations are supported e.g. addition, subtraction, magnitude (aka length), angle conversion (aka angle_from_x_axis), dot and cross product.

Trait Implementations

impl VectorExt for Vector[src]

fn with_angle(angle: Radian) -> Vector[src]

Creates a new Vector from an angle, from the X axis.

fn tangent(&self) -> Radian[src]

Returns an angle that is tangent to this Vector. Maybe useful for your dodging behavior. Read more