Extracted from Pike v7.4 release 117 at 2004-11-02.
pike.ida.liu.se
[Top]
predef::
Math
Math.SMatrix

Method Math.SMatrix()->create()


Method create

void Math.SMatrix(array(array(int|float)) 2d_matrix)
void Math.SMatrix(array(int|float) 1d_matrix)
void Math.SMatrix(int n, int m)
void Math.SMatrix(int n, int m, string type)
void Math.SMatrix(int n, int m, float|int init)
void Math.SMatrix("identity", int size)
void Math.SMatrix("rotate", int size, float rads, Matrix axis)
void Math.SMatrix("rotate", int size, float rads, float x, float y, float z)

Description

This method initializes the matrix. It is illegal to create and hold an empty matrix.

The normal operation is to create the matrix object with a double array, like Math.Matrix( ({({1,2}),({3,4})}) ).

Another use is to create a special type of matrix, and this is told as third argument.

Currently there are only the "identity" type, which gives a matrix of zeroes except in the diagonal, where the number one (1.0) is. This is the default, too.

The third use is to give all indices in the matrix the same value, for instance zero or 42.

The forth use is some special matrixes. First the square identity matrix again, then the rotation matrix.