RealVector:
Filter:
VectorSpace/Classes (extension) | Math

RealVector
ExtensionExtension

an element of R^N

Description

Represents an element of R^N. Usual operations are implemented.

NOTE: for 2D and 3D vectors, there are available the classes RealVector2D and RealVector3D which are roughly 10% faster than RealVector.

Class Methods

.rand

random vector.

Arguments:

size

dimension of vector.

lo, hi

range of values

.canonB

ith element of canonic base of R^N.

Instance Methods

.cross


cross product
NOTE: The vectors should be 3 dimensional, and no error checking is done for speed.

.asPoint

.theta

.zero

Make a zero vector

Arguments:

dim

Dimensions of the vector. This is not needed for RealVector2D.zero or RealVector3D.zero.