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 x of this matrix. |
.[1]: Vector | Returns the vector y of this matrix. |
.[2]: Vector | Returns the vector z of this matrix. |
Basic Getter Methods
Properties | Description |
---|---|
.x(): Scalar | Returns the value x of this matrix. |
.y(): Scalar | Returns the value y of this matrix. |
.z(): Scalar | Returns the value z of 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, z of 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. |