ForceColumnVector

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function added by the Oblivion Script Extender.

Syntax:

(colVector:array) ForceColumnVector vector1d:array 
(colVector:array) ColVec vector1d:array

Takes a one-dimensional array, and returns an equivalent two-dimensional array, where the outer array's elements are each arrays with only one element - each element in the 1d array. I.e., A[i][0] == v[i]. This forces various linear algebra functions to treat the vector as a column vector, and can be necessary when using MatrixMultiply.

Note that row vectors require only 2 array variables, as opposed to the n+1 (where n is the number of elements) array variables needed for column vectors; for this reason, row vectors are generally preferred.