Package com.aowagie.text.pdf.parser
Class Matrix
- java.lang.Object
-
- com.aowagie.text.pdf.parser.Matrix
-
class Matrix extends java.lang.ObjectKeeps all the values of a 3 by 3 matrix and allows you to do some math with matrices.- Since:
- 2.1.4
-
-
Field Summary
Fields Modifier and Type Field Description private static intI11an array position referring to a specific value in the matrix.private static intI12an array position referring to a specific value in the matrix.private static intI13an array position referring to a specific value in the matrix.private static intI21an array position referring to a specific value in the matrix.private static intI22an array position referring to a specific value in the matrix.private static intI23an array position referring to a specific value in the matrix.static intI31an array position referring to a specific value in the matrix.static intI32an array position referring to a specific value in the matrix.private static intI33an array position referring to a specific value in the matrix.private float[]valsthe values inside the matrix (the identity matrix by default).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Checks equality of matrices.floatget(int index)Gets a specific value inside the matrix.inthashCode()Generates a hash code for this object.Matrixmultiply(Matrix by)multiplies this matrix by 'b' and returns the result See http://en.wikipedia.org/wiki/Matrix_multiplicationjava.lang.StringtoString()Generates a String representating of the matrix.
-
-
-
Field Detail
-
I11
private static final int I11
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I12
private static final int I12
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I13
private static final int I13
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I21
private static final int I21
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I22
private static final int I22
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I23
private static final int I23
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I31
public static final int I31
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I32
public static final int I32
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
I33
private static final int I33
an array position referring to a specific value in the matrix.- See Also:
- Constant Field Values
-
vals
private final float[] vals
the values inside the matrix (the identity matrix by default).
-
-
Constructor Detail
-
Matrix
public Matrix()
constructs a new Matrix with identity.
-
Matrix
public Matrix(float tx, float ty)Constructs a matrix that represents translation- Parameters:
tx-ty-
-
Matrix
public Matrix(float a, float b, float c, float d, float e, float f)Creates a Matrix with 6 specified entries- Parameters:
a-b-c-d-e-f-
-
-
Method Detail
-
get
public float get(int index)
Gets a specific value inside the matrix.- Parameters:
index- an array index corresponding with a value inside the matrix- Returns:
- the value at that specific position.
-
multiply
public Matrix multiply(Matrix by)
multiplies this matrix by 'b' and returns the result See http://en.wikipedia.org/wiki/Matrix_multiplication- Parameters:
by- The matrix to multiply by- Returns:
- the resulting matrix
-
equals
public boolean equals(java.lang.Object obj)
Checks equality of matrices.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the other Matrix that needs to be compared with this matrix.- Returns:
- true if both matrices are equal
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Generates a hash code for this object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code of this object
- See Also:
Object.hashCode()
-
toString
public java.lang.String toString()
Generates a String representating of the matrix.- Overrides:
toStringin classjava.lang.Object- Returns:
- the values, delimited with tabs and newlines.
- See Also:
Object.toString()
-
-