|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Matrix
A class to represent a 4x4 transformational matrix
Field Summary | |
double[][] |
m
double m[4][4] purpose : store the values of the matrix |
Constructor Summary | |
Matrix()
Default constructor purpose : initialize the matrix to a zero matrix |
|
Matrix(Matrix x)
Copy constructor purpose : initialize the matrix to the input Matrix x |
Method Summary | |
static Matrix |
identity()
purpose : create an identity matrix |
static Matrix |
minus(Matrix a,
Matrix b)
purpose : subtract one matrix by another matrix |
static Matrix |
multi(Matrix a,
Matrix b)
purpose : multiply two matrices |
static Matrix |
plus(Matrix a,
Matrix b)
purpose : add two matrices |
void |
print()
purpose : print the matrix |
static Matrix |
rotate(char axis,
double angle)
purpose : create a rotational matrix |
static Matrix |
scale(double sx,
double sy,
double sz)
purpose : create a scale matrix |
static Matrix |
translate(double tx,
double ty,
double tz)
purpose : create a translational matrix |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public double[][] m
Constructor Detail |
public Matrix()
public Matrix(Matrix x)
x
- MatrixMethod Detail |
public static Matrix identity()
public static Matrix plus(Matrix a, Matrix b)
a
- first Matrixb
- second Matrixpublic static Matrix minus(Matrix a, Matrix b)
a
- first Matrixb
- second Matrixpublic static Matrix multi(Matrix a, Matrix b)
a
- first Matrixb
- second Matrixpublic static Matrix translate(double tx, double ty, double tz)
tx
- translate distance along x-axisty
- translate distance along y-axistz
- translate distance along z-axispublic static Matrix scale(double sx, double sy, double sz)
sx
- scale factor along x-axissy
- scale factor along y-axissz
- scale factor along z-axispublic static Matrix rotate(char axis, double angle)
axis
- rotation axis (x, y or z)angle
- rotate by angle in radianpublic void print()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |