|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMatrix2D
public class Matrix2D
This Matrix2D class provides a base for exploring two-dimensional transformations.
Its only instance field, matrix, is a 3×3 array of double.
| Constructor Summary | |
|---|---|
Matrix2D()
construct the ZERO matrix (all elements are 0) |
|
Matrix2D(double[] e)
constructs a Matrix2D object from the given 3n-element array of double (row major). |
|
Matrix2D(double[][] matrix)
constructs a Matrix2D object from the elements of the given 3×n array of double. |
|
Matrix2D(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
constructs a Matrix2D object from the 9 doubles. |
|
Matrix2D(Matrix2D other)
Constructs a Matrix2D object using the elements of the Matrix2D parameter |
|
| Method Summary | |
|---|---|
Matrix2D |
add(Matrix2D other)
Constructs and returns a new Matrix2D object consisting of the sum of the elements in the same corresponding position |
double[][] |
getElements()
Accessor method used to retrieve the elements of the Matrix2D object |
Matrix2D |
mul(double[][] other)
Constructs and returns a new Matrix2D object consisting of the matrix product |
Matrix2D |
mul(Matrix2D other)
Constructs and returns a new Matrix2D object consisting of the matrix product |
void |
setElements(double[][] e)
Assigns new values to the Matrix2D object using the elements of the array parameter |
Matrix2D |
sub(Matrix2D other)
Constructs and returns a new Matrix2D object consisting of the difference of the elements in the same corresponding position |
java.lang.String |
toString()
Returns a beautiful, 2-dimensional, tab-delimited String rendering an image of the Matrix2D object |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Matrix2D()
public Matrix2D(double[][] matrix)
double.
matrix - The 3×3 array of double.public Matrix2D(double[] e)
double (row major).
e - The 9-element array of double.
public Matrix2D(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
doubles. (row major)
m00 - m00.m01 - m01.m02 - m02.m10 - m10.m11 - m11.m12 - m12.m20 - m20.m21 - m21.m22 - m22.public Matrix2D(Matrix2D other)
other - The Matrix2D object to be cloned.| Method Detail |
|---|
public void setElements(double[][] e)
e - The new set of elementspublic double[][] getElements()
doublespublic Matrix2D add(Matrix2D other)
other - the addend
public Matrix2D sub(Matrix2D other)
other - the subtrahend
public Matrix2D mul(Matrix2D other)
other - the multiplier
public Matrix2D mul(double[][] other)
other - the multiplier
public java.lang.String toString()
String rendering an image of the Matrix2D object
toString in class java.lang.ObjectString representation of the matrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||