MathLib.Vector()

MathLib.Vector is MathLib's implementation of vectors. The function expects one argument, the array of entries of the vector. \[ \text{MathLib.Vector}([a_1, a_2, \dots, a_n]) = \begin{pmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{pmatrix} \]

Examples

// The Vector with entries 1, 2 and 3 var v = MathLib.Vector([1, 2, 3]);

Properties

.constructor
The function MathLib.Vector.
.length
The number of entries in the vector.
.type
The string "vector".

Methods

.compare()
A compare method for vectors.
.evaluate()
Evaluates the entries of the vector.
.every()
Works like Array.prototype.every
.forEach()
Works like Array.prototype.forEach
.isEqual()
Determines if two vectors are equal
.isZero()
Determines if the vector is the zero vector.
.map()
Works like Array.prototype.map
.minus()
Calculates the difference of two vectors.
.negative()
Returns the negative vector.
.norm()
Determines the length of the vector.
.outerProduct()
Calculates the outer product of two vectors.
.plus()
Calculates the sum of two vectors.
.reduce()
Works like Array.prototype.reduce
.scalarProduct()
Calculates the scalar product of two vectors.
.slice()
Works like Array.prototype.slice
.times()
Multiplies the vector by a (complex) number or a matrix.
.toArray()
Converts the vector to an array.
.toContentMathML()
Returns the content MathML representation of the vector.
.toLaTeX()
Returns a LaTeX representation of the vector.
.toMathML()
Returns the (presentation) MathML representation of the vector.
.toString()
Returns a string representation of the vector.
.vectorProduct()
Calculates the vectorproduct of two (three-dimensional) vectors.

Static methods

.areLinearIndependent()
Checks if some vectors are linear independent.
.zero()
Returns a zero vector of given size.