Matrix3D

Inheritance: java.lang.Object

public final class Matrix3D

Class represents transformation matrix.

Constructors

ConstructorDescription
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

MethodDescription
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:

ParameterTypeDescription
matrix3DArraydouble[]Matrix data array.

Matrix3D(Matrix3D matrix)

public Matrix3D(Matrix3D matrix)

Constructor accepts a matrix to create a copy

Parameters:

ParameterTypeDescription
matrixMatrix3DMatrix3D 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:

ParameterTypeDescription
adoubleA matrix value.
bdoubleB matrix value.
cdoubleC matrix value.
ddoubleD matrix value.
edoubleE matrix value.
fdoubleF matrix value.
gdoubleG matrix value.
hdoubleH matrix value.
idoubleI matrix value.
txdoubleTX matrix value.
tydoubleTX matrix value.
tzdoubleTY 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
valuedoubledouble 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:

ParameterTypeDescription
objjava.lang.ObjectObject 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:

ParameterTypeDescription
rotationintRotation value.

Returns: double - Angle value.

add(Matrix3D other)

public Matrix3D add(Matrix3D other)

Adds matrix to other matrix.


Parameters:

ParameterTypeDescription
otherMatrix3DMatrix to be added.

Returns: Matrix3D - Result of matrix add.

hashCode()

public int hashCode()

Hash-code for object.


Returns: int - Hash-code.