public class Matrix extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
I11 |
the row=1, col=1 position ('a') in the matrix.
|
static int |
I12 |
the row=1, col=2 position ('b') in the matrix.
|
static int |
I13 |
the row=1, col=3 position (always 0 for 2-D) in the matrix.
|
static int |
I21 |
the row=2, col=1 position ('c') in the matrix.
|
static int |
I22 |
the row=2, col=2 position ('d') in the matrix.
|
static int |
I23 |
the row=2, col=3 position (always 0 for 2-D) in the matrix.
|
static int |
I31 |
the row=3, col=1 ('e', or X translation) position in the matrix.
|
static int |
I32 |
the row=3, col=2 ('f', or Y translation) position in the matrix.
|
static int |
I33 |
the row=3, col=3 position (always 1 for 2-D) in the matrix.
|
Constructor | Description |
---|---|
Matrix() |
constructs a new Matrix with identity.
|
Matrix(float tx,
float ty) |
Constructs a matrix that represents translation
|
Matrix(float a,
float b,
float c,
float d,
float e,
float f) |
Creates a Matrix with 6 specified entries
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
Checks equality of matrices.
|
float |
get(int index) |
Gets a specific value inside the matrix.
|
float |
getDeterminant() |
Computes the determinant of the matrix.
|
int |
hashCode() |
Generates a hash code for this object.
|
Matrix |
multiply(Matrix by) |
multiplies this matrix by 'b' and returns the result
See http://en.wikipedia.org/wiki/Matrix_multiplication
|
Matrix |
subtract(Matrix arg) |
Subtracts a matrix from this matrix and returns the results
|
String |
toString() |
Generates a String representation of the matrix.
|
public static final int I11
public static final int I12
public static final int I13
public static final int I21
public static final int I22
public static final int I23
public static final int I31
public static final int I32
public static final int I33
public Matrix()
public Matrix(float tx, float ty)
tx
- ty
- public Matrix(float a, float b, float c, float d, float e, float f)
a
- b
- c
- d
- e
- f
- public float get(int index)
For reference, the indeces are as follows:
I11 I12 I13
I21 I22 I23
I31 I32 I33
index
- an array index corresponding with a value inside the matrixpublic Matrix multiply(Matrix by)
by
- The matrix to multiply bypublic Matrix subtract(Matrix arg)
arg
- the matrix to subtract from this matrixpublic float getDeterminant()
public boolean equals(Object obj)
equals
in class Object
obj
- the other Matrix that needs to be compared with this matrix.Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2018. All rights reserved.