Class CP::Vect
In: doc_dummy.rb
Parent: Object

Basic 2D vector class.

Methods

*   +   -   -@   /   cross   dot   length   lengthsd   near?   new   normalize   normalize!   perp   project   rotate   to_a   to_angle   to_s   unrotate  

Attributes

x  [RW] 
y  [RW] 

Public Class methods

Public Instance methods

Scalar multiplication.

Vector addition.

Vector subtraction.

Vector negation.

Scalar division.

2D cross product analog. Z component of the 3D cross product.

Vector dot product.

Length of the vector.

Squared ength of the vector.

Returns true if self and vect are within dist.

Normalize a vector.

Normalize a vector in place.

Get the perpendicular vector.

Vector projection of self onto vect.

Rotate and scale self by vect using complex multiplication.

Return the vector as an array.

Get the angle (in radians) the vector is pointing in.

[Validate]