Matrix3D
Inheritance: java.lang.Object
public final class Matrix3D
Class represents transformation matrix.
Constructors
Constructor | Description |
---|---|
Matrix3D() | Constructor creates standard 1 to 1 matrix: [ A B C D E F G H I Tx Ty Tz] = [ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 , 0] |
Matrix3D(double[] matrix3DArray) | Constructor accepts a matrix with following array representation: [ A B C D E F G H I Tx Ty Tz] |
Matrix3D(Matrix3D matrix) | Constructor accepts a matrix to create a copy |
Matrix3D(double a, double b, double c, double d, double e, double f, double g, double h, double i, double tx, double ty, double tz) | Initializes transformation matrix with specified coefficients. |
Methods
Method | Description |
---|---|
getA() | A member of the transformation matrix. |
setA(double value) | A member of the transformation matrix. |
getB() | B member of the transformation matrix. |
setB(double value) | B member of the transformation matrix. |
getC() | C member of the transformation matrix. |
setC(double value) | C member of the transformation matrix. |
getD() | D member of the transformation matrix. |
setD(double value) | D member of the transformation matrix. |
getE() | E member of the transformation matrix. |
setE(double value) | E member of the transformation matrix. |
getF() | F member of the transformation matrix. |
setF(double value) | F member of the transformation matrix. |
getG() | G member of the transformation matrix. |
setG(double value) | G member of the transformation matrix. |
getH() | H member of the transformation matrix. |
setH(double value) | H member of the transformation matrix. |
getI() | I member of the transformation matrix. |
setI(double value) | I member of the transformation matrix. |
getTx() | Tx member of the transformation matrix. |
setTx(double value) | Tx member of the transformation matrix. |
getTy() | Ty member of the transformation matrix. |
setTy(double value) | Ty member of the transformation matrix. |
getTz() | Tz member of the transformation matrix. |
setTz(double value) | Tz member of the transformation matrix. |
toString() | Returns text representation of the matrix. |
equals(Object obj) | Compares matrix against other object. |
getAngle(int rotation) | Translates rotation into angle (degrees) |
add(Matrix3D other) | Adds matrix to other matrix. |
hashCode() | Hash-code for object. |
Matrix3D()
public Matrix3D()
Constructor creates standard 1 to 1 matrix: [ A B C D E F G H I Tx Ty Tz] = [ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 , 0]
Matrix3D m = new Matrix3D();
Matrix3D(double[] matrix3DArray)
public Matrix3D(double[] matrix3DArray)
Constructor accepts a matrix with following array representation: [ A B C D E F G H I Tx Ty Tz]
double[] c = new double[] { 1, 0, 0, 1, 10, 20, 1, 0, 0, 17, 40, 13 };
Matrix3D m = new Matrix3D(c);
Parameters:
Parameter | Type | Description |
---|---|---|
matrix3DArray | double[] | Matrix data array. |
Matrix3D(Matrix3D matrix)
public Matrix3D(Matrix3D matrix)
Constructor accepts a matrix to create a copy
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix3D | Matrix3D object. |
Matrix3D(double a, double b, double c, double d, double e, double f, double g, double h, double i, double tx, double ty, double tz)
public Matrix3D(double a, double b, double c, double d, double e, double f, double g, double h, double i, double tx, double ty, double tz)
Initializes transformation matrix with specified coefficients.
Matrix m = new Matrix(1, 0, 0, 1, 3, 3);
Parameters:
Parameter | Type | Description |
---|---|---|
a | double | A matrix value. |
b | double | B matrix value. |
c | double | C matrix value. |
d | double | D matrix value. |
e | double | E matrix value. |
f | double | F matrix value. |
g | double | G matrix value. |
h | double | H matrix value. |
i | double | I matrix value. |
tx | double | TX matrix value. |
ty | double | TX matrix value. |
tz | double | TY matrix value. |
getA()
public double getA()
A member of the transformation matrix.
Returns: double - double value
setA(double value)
public void setA(double value)
A member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getB()
public double getB()
B member of the transformation matrix.
Returns: double - double value
setB(double value)
public void setB(double value)
B member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getC()
public double getC()
C member of the transformation matrix.
Returns: double - double value
setC(double value)
public void setC(double value)
C member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getD()
public double getD()
D member of the transformation matrix.
Returns: double - double value
setD(double value)
public void setD(double value)
D member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getE()
public double getE()
E member of the transformation matrix.
Returns: double - double value
setE(double value)
public void setE(double value)
E member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getF()
public double getF()
F member of the transformation matrix.
Returns: double - double value
setF(double value)
public void setF(double value)
F member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getG()
public double getG()
G member of the transformation matrix.
Returns: double - double value
setG(double value)
public void setG(double value)
G member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getH()
public double getH()
H member of the transformation matrix.
Returns: double - double value
setH(double value)
public void setH(double value)
H member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getI()
public double getI()
I member of the transformation matrix.
Returns: double - double value
setI(double value)
public void setI(double value)
I member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getTx()
public double getTx()
Tx member of the transformation matrix.
Returns: double - double value
setTx(double value)
public void setTx(double value)
Tx member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getTy()
public double getTy()
Ty member of the transformation matrix.
Returns: double - double value
setTy(double value)
public void setTy(double value)
Ty member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
getTz()
public double getTz()
Tz member of the transformation matrix.
Returns: double - double value
setTz(double value)
public void setTz(double value)
Tz member of the transformation matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | double value |
toString()
public String toString()
Returns text representation of the matrix.
Returns: java.lang.String - String representation for the matrix
equals(Object obj)
public boolean equals(Object obj)
Compares matrix against other object.
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | Object to compare. |
Returns: boolean - Returns true is other object is Matrix3D and all matrix members are equal to corresponding members of the matrix
getAngle(int rotation)
public static double getAngle(int rotation)
Translates rotation into angle (degrees)
double angle = Matrix.getAngle(Rotation.on90);
Matrix m = Matrix.rotation(angle);
Parameters:
Parameter | Type | Description |
---|---|---|
rotation | int | Rotation value. |
Returns: double - Angle value.
add(Matrix3D other)
public Matrix3D add(Matrix3D other)
Adds matrix to other matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
other | Matrix3D | Matrix to be added. |
Returns: Matrix3D - Result of matrix add.
hashCode()
public int hashCode()
Hash-code for object.
Returns: int - Hash-code.