Class matrix3D.Matrix3D
All Packages Class Hierarchy This Package Previous Next Index
source
Class matrix3D.Matrix3D
java.lang.Object
|
+----matrix3D.Matrix3D
- public class Matrix3D
- extends Object
A 4x4 matrix for doing 3D transforms.
-
desc
- A description of the matrix.
-
m
- The two dimensional array which contains the matrix elements.
-
name
- The matrix's name.
-
purpose
- A description of the matrix's purpose.
-
Matrix3D()
- Construct a matrix initialized to the identity matrix.
-
Matrix3D(String)
- Construct a named matrix initialized to the identity matrix.
-
Matrix3D(String, String)
- Construct a named matrix with a purpose and initialize it to the
identity matrix.
-
Matrix3D(String, String, String)
- Construct a named matrix with a description and purpose, and
initialize it to the identity matrix.
-
cross(Matrix3D, int, Matrix3D, int)
- Return the cross product of a matrix's row and another matrix's
column.
-
dot(Matrix3D)
- Return the matrix dot product of this and another matrx.
-
dot(Vector3D)
- Return the vector dot product of this matrix and a vector.
-
draw(Graphics)
- Draw the matrix.
-
getElement(int, int)
- Return a string representation of the specified element.
-
identity()
- Set the matrix to the identity matrix.
-
isIdentity()
- Return true if the matrix is equal to the identity matrix, false
otherwise.
-
printString()
- Print a string representation of this matrix.
-
setElement(int, int, double)
-
-
setEqual(Matrix3D)
- Set this matrix's contents to the contents of another matrix.
-
toString()
- Return a string representation of this matrix.
m
public double m[][]
- The two dimensional array which contains the matrix elements.
Elements are referenced by [row][col] and start at [0][0].
desc
public String desc
- A description of the matrix. More specific matrices will use this
to give a text description of their contents, such as
"Translate (dx = 23, dy = 15, dz = 45)".
name
public String name
- The matrix's name.
purpose
public String purpose
- A description of the matrix's purpose.
More specific matrices will use this
to give a description of their purpose, such as
"translate window to origin".
Matrix3D
public Matrix3D()
- Construct a matrix initialized to the identity matrix.
Matrix3D
public Matrix3D(String nameIn)
- Construct a named matrix initialized to the identity matrix.
Matrix3D
public Matrix3D(String nameIn,
String purposeIn)
- Construct a named matrix with a purpose and initialize it to the
identity matrix.
Matrix3D
public Matrix3D(String nameIn,
String purposeIn,
String descIn)
- Construct a named matrix with a description and purpose, and
initialize it to the identity matrix.
cross
public double cross(Matrix3D m1,
int row,
Matrix3D m2,
int col)
- Return the cross product of a matrix's row and another matrix's
column.
- Returns:
- m1[row][*] CROSS m2[*][col]
isIdentity
public boolean isIdentity()
- Return true if the matrix is equal to the identity matrix, false
otherwise.
identity
public void identity()
- Set the matrix to the identity matrix.
dot
public Matrix3D dot(Matrix3D mIn)
- Return the matrix dot product of this and another matrx.
- Returns:
- [this] DOT [mIn]
dot
public Vector3D dot(Vector3D vIn)
- Return the vector dot product of this matrix and a vector.
- Returns:
- [this] . [vIn]
getElement
public String getElement(int row,
int col)
- Return a string representation of the specified element.
draw
public void draw(Graphics g)
- Draw the matrix. Use drawString to draw the matrix contents into
the specified graphics context.
setElement
public void setElement(int row,
int col,
double d)
setEqual
public void setEqual(Matrix3D mIn)
- Set this matrix's contents to the contents of another matrix.
toString
public String toString()
- Return a string representation of this matrix.
- Overrides:
- toString in class Object
printString
public void printString()
- Print a string representation of this matrix. Print the matrix
with each row as a seperate line.
All Packages Class Hierarchy This Package Previous Next Index