MatrixMultiply

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

A function added by the Oblivion Script Extender.

Syntax:

(product:array) MatrixMultiply factor:array factor:array 
(product:array) MatMult factor:array factor:array

Returns the product of two matrices using matrix multiplication. Matrix multiplication is not commutative, that is, order matters and AB != BA. In order to multiply two matrices, the width of the first factor must equal the height of the second.

Two one-dimensional arrays (as opposed to two-dimensional vectors) cannot be multiplied because a column vector multiplied by a row vector has a different result than if a row vector is multiplied by a column vector, even if all the values are the same. Therefore, at least one of the vectors must be represented as a two-dimensional array (usually using ForceRowVector) to remove this ambiguity (they do not both need to be two-dimensional as a column vector cannot be multiplied with another column vector, nor a row vector with another row vector, so there is no ambiguity).