Matrix
Code Example
::STAR::Matrix a( 0, 1, 0 );
::STAR::Matrix b(); // will be initialised to( 0 )
::STAR::Matrix c = a + b;
Constructor
Matix matrix(
 Scalar xx, Scalar xy, Scalar xz,
 Scalar yx, Scalar yy, Scalar yz,
 Scalar zx, Scalar zy, Scalar zz
)
Matrix matrix(Vector x, Vector y, Vector z)
Matrix matrix(Matrix m)
- x - the x vector of this matrix. Default is Vector(0, 0, 0)
- y - the y vector of this matrix. Default is Vector(0, 0, 0)
- z - the z vector of this matrix. Default is Vector(0, 0, 0)
Methods
Basic Properties Methods
Basic Operations
| Properties | Description | 
|---|---|
| .[0]: Vector | Returns the vector xof this matrix. | 
| .[1]: Vector | Returns the vector yof this matrix. | 
| .[2]: Vector | Returns the vector zof this matrix. | 
Basic Getter Methods
| Properties | Description | 
|---|---|
| .x(): Scalar | Returns the value xof this matrix. | 
| .y(): Scalar | Returns the value yof this matrix. | 
| .z(): Scalar | Returns the value zof this matrix. | 
| .print(): void | 
Basic Setter Methods
| Properties | Description | 
|---|---|
| .set(Scalar s): this | Copies the value to this Matrix x, y, z. | 
| .set(Matrix m): this | Copies the values x, y, zof to this Matrix. | 
| .set_rotation_x(Scalar s): this | Copies | 
| .set_rotation_y(Scalar s): this | Copies | 
| .set_rotation_z(Scalar s): this | Copies | 
Basic Math Methods
Basic Operations
| Properties | Description | 
|---|---|
| +(): Matrix | |
| -(): Matrix | |
| +(Scalar s): Matrix | |
| -(Scalar s): Matrix | |
| *(Scalar s): Matrix | |
| /(Scalar s): Matrix | |
| +(Matrix m): Matrix | Calculates the dot add product of this matrix and v. | 
| -(Matrix m): Matrix | Calculates the dot sub product of this matrix and v. | 
| *(Matrix m): Matrix | Calculates the cross product of this matrix and v. | 
| *(Vector v): Vector | Calculates the cross product of this matrix and v. | 
Basic Calculations
| Properties | Description | 
|---|---|
| .tdotx( Vector v ): Vector | Calculates the dot product of this matrix x and v. | 
| .tdoty( Vector v ): Vector | Calculates the dot product of this matrix y and v. | 
| .tdotz( Vector v ): Vector | Calculates the dot product of this matrix z and v. |