Package com.lowagie.text.pdf.parser
Class Matrix
- java.lang.Object
-
- com.lowagie.text.pdf.parser.Matrix
-
public class Matrix extends Object
Keeps 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 static intI11the row=1, col=1 position ('a') in the matrix.static intI12the row=1, col=2 position ('b') in the matrix.static intI13the row=1, col=3 position (always 0 for 2-D) in the matrix.static intI21the row=2, col=1 position ('c') in the matrix.static intI22the row=2, col=2 position ('d') in the matrix.static intI23the row=2, col=3 position (always 0 for 2-D) in the matrix.static intI31the row=3, col=1 ('e', or X translation) position in the matrix.static intI32the row=3, col=2 ('f', or Y translation) position in the matrix.static intI33the row=3, col=3 position (always 1 for 2-D) in the matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(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_multiplicationMatrixsubtract(Matrix arg)Subtracts a matrix from this matrix and returns the resultsStringtoString()Generates a String representation of the matrix.
-
-
-
Field Detail
-
I11
public static final int I11
the row=1, col=1 position ('a') in the matrix.- See Also:
- Constant Field Values
-
I12
public static final int I12
the row=1, col=2 position ('b') in the matrix.- See Also:
- Constant Field Values
-
I13
public static final int I13
the row=1, col=3 position (always 0 for 2-D) in the matrix.- See Also:
- Constant Field Values
-
I21
public static final int I21
the row=2, col=1 position ('c') in the matrix.- See Also:
- Constant Field Values
-
I22
public static final int I22
the row=2, col=2 position ('d') in the matrix.- See Also:
- Constant Field Values
-
I23
public static final int I23
the row=2, col=3 position (always 0 for 2-D) in the matrix.- See Also:
- Constant Field Values
-
I31
public static final int I31
the row=3, col=1 ('e', or X translation) position in the matrix.- See Also:
- Constant Field Values
-
I32
public static final int I32
the row=3, col=2 ('f', or Y translation) position in the matrix.- See Also:
- Constant Field Values
-
I33
public static final int I33
the row=3, col=3 position (always 1 for 2-D) in the matrix.- See Also:
- Constant Field Values
-
-
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
-
subtract
public Matrix subtract(Matrix arg)
Subtracts a matrix from this matrix and returns the results- Parameters:
arg- the matrix to subtract from this matrix- Returns:
- the resulting matrix
-
equals
public boolean equals(Object obj)
Checks equality of matrices.- Overrides:
equalsin classObject- 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 classObject- Returns:
- the hash code of this object
- See Also:
Object.hashCode()
-
toString
public String toString()
Generates a String representation of the matrix.- Overrides:
toStringin classObject- Returns:
- the values, delimited with tabs and newlines.
- See Also:
Object.toString()
-
-