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.

Variable Index

 o desc
A description of the matrix.
 o m
The two dimensional array which contains the matrix elements.
 o name
The matrix's name.
 o purpose
A description of the matrix's purpose.

Constructor Index

 o Matrix3D()
Construct a matrix initialized to the identity matrix.
 o Matrix3D(String)
Construct a named matrix initialized to the identity matrix.
 o Matrix3D(String, String)
Construct a named matrix with a purpose and initialize it to the identity matrix.
 o Matrix3D(String, String, String)
Construct a named matrix with a description and purpose, and initialize it to the identity matrix.

Method Index

 o cross(Matrix3D, int, Matrix3D, int)
Return the cross product of a matrix's row and another matrix's column.
 o dot(Matrix3D)
Return the matrix dot product of this and another matrx.
 o dot(Vector3D)
Return the vector dot product of this matrix and a vector.
 o draw(Graphics)
Draw the matrix.
 o getElement(int, int)
Return a string representation of the specified element.
 o identity()
Set the matrix to the identity matrix.
 o isIdentity()
Return true if the matrix is equal to the identity matrix, false otherwise.
 o printString()
Print a string representation of this matrix.
 o setElement(int, int, double)
 o setEqual(Matrix3D)
Set this matrix's contents to the contents of another matrix.
 o toString()
Return a string representation of this matrix.

Variables

 o m
  public double m[][]
The two dimensional array which contains the matrix elements. Elements are referenced by [row][col] and start at [0][0].
 o 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)".
 o name
  public String name
The matrix's name.
 o 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".

Constructors

 o Matrix3D
  public Matrix3D()
Construct a matrix initialized to the identity matrix.
 o Matrix3D
  public Matrix3D(String nameIn)
Construct a named matrix initialized to the identity matrix.
 o Matrix3D
  public Matrix3D(String nameIn,
                  String purposeIn)
Construct a named matrix with a purpose and initialize it to the identity matrix.
 o 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.

Methods

 o 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]
 o isIdentity
  public boolean isIdentity()
Return true if the matrix is equal to the identity matrix, false otherwise.
 o identity
  public void identity()
Set the matrix to the identity matrix.
 o dot
  public Matrix3D dot(Matrix3D mIn)
Return the matrix dot product of this and another matrx.
Returns:
[this] DOT [mIn]
 o dot
  public Vector3D dot(Vector3D vIn)
Return the vector dot product of this matrix and a vector.
Returns:
[this] . [vIn]
 o getElement
  public String getElement(int row,
                           int col)
Return a string representation of the specified element.
 o draw
  public void draw(Graphics g)
Draw the matrix. Use drawString to draw the matrix contents into the specified graphics context.
 o setElement
  public void setElement(int row,
                         int col,
                         double d)
 o setEqual
  public void setEqual(Matrix3D mIn)
Set this matrix's contents to the contents of another matrix.
 o toString
  public String toString()
Return a string representation of this matrix.
Overrides:
toString in class Object
 o 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