The table below details the operators currently implemented in VC. The following expression is an example of vector/matrix product computation.
Equation 8-3. Expression with a Vector/Matrix Product
| Operation | Sign | Arg1 | Arg2 | Return |
|---|---|---|---|---|
| addition | + | FLOAT or INT | FLOAT or INT | FLOAT |
| substraction | - | FLOAT or INT | FLOAT or INT | FLOAT |
| multiplication | * | FLOAT or INT | FLOAT or INT | FLOAT |
| division | / | FLOAT or INT | FLOAT or INT | FLOAT |
| modulus (remainder of int. division) | % | INT | INT | INT |
| matrix/table multiplication | * | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 3-TABLE | FLOAT or INT 3-TABLE |
| homogeneous matrix/table multiplication | * | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 4-TABLE | FLOAT or INT 4-TABLE |
| table/matrix multiplication | * | FLOAT or INT 3-TABLE | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 3-TABLE |
| homogeneous table/matrix multiplication | * | FLOAT or INT 4-TABLE | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 4-TABLE |
| matrix/matrix multiplication | * | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 4x4-MATRIX or 16-TABLE | FLOAT or INT 4x4-MATRIX or 16-TABLE |
The * operator can be used to compute the product of a 4x4 matrix (or a 16 element table) by a 3D table (a vector in cartesian coordinates) or the product of a 3D table by a 4x4 matrix. The output is stored in a 3D table. The * operator can also be applied to vectors with homogenous coordinates: it uses 4D tables that represent points or vectors in homogenous coordinates and stores the results in 4D tables.