jmathlib.core.graphics
Class Matrix3D

java.lang.Object
  extended by jmathlib.core.graphics.Matrix3D

public class Matrix3D
extends java.lang.Object

A fairly conventional 3D matrix object that can transform sets of 3D points and perform a variety of manipulations on the transform


Field Summary
(package private)  double[][] matrix
           
(package private) static double pi
           
(package private)  double[][] unitMatrix
           
(package private)  double xo
           
(package private)  double xx
           
(package private)  double xy
           
(package private)  double xz
           
(package private)  double yo
           
(package private)  double yx
           
(package private)  double yy
           
(package private)  double yz
           
(package private)  double zo
           
(package private)  double zx
           
(package private)  double zy
           
(package private)  double zz
           
 
Constructor Summary
Matrix3D()
          Create a new unit matrix
 
Method Summary
 void mult(Matrix3D rhs)
          Multiply this matrix by a second: M = M*R
 void scale(double f)
          Scale by f in all dimensions
 void scale(double xf, double yf, double zf)
          Scale along each axis independently
 void transform(double[][] x, double[][] y, double[][] z, int[][] tx, int[][] ty, int[][] tz)
          Transform nvert points from v into tv.
 void transform(double[] x, double[] y, double[] z, int[] tx, int[] ty, int[] tz)
          Transform nvert points from v into tv.
 java.awt.Point transform(double x, double y, double z)
           
 void translate(double x, double y, double z)
          Translate the origin
 void unit()
          Reinitialize to the unit matrix
 void xrot(double theta)
          rotate theta degrees about the x axis
 void yrot(double theta)
          rotate theta degrees about the y axis
 void zrot(double theta)
          rotate theta degrees about the z axis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xx

double xx

xy

double xy

xz

double xz

xo

double xo

yx

double yx

yy

double yy

yz

double yz

yo

double yo

zx

double zx

zy

double zy

zz

double zz

zo

double zo

pi

static final double pi
See Also:
Constant Field Values

matrix

double[][] matrix

unitMatrix

double[][] unitMatrix
Constructor Detail

Matrix3D

public Matrix3D()
Create a new unit matrix

Method Detail

scale

public void scale(double f)
Scale by f in all dimensions


scale

public void scale(double xf,
                  double yf,
                  double zf)
Scale along each axis independently


translate

public void translate(double x,
                      double y,
                      double z)
Translate the origin


yrot

public void yrot(double theta)
rotate theta degrees about the y axis


xrot

public void xrot(double theta)
rotate theta degrees about the x axis


zrot

public void zrot(double theta)
rotate theta degrees about the z axis


mult

public void mult(Matrix3D rhs)
Multiply this matrix by a second: M = M*R


unit

public void unit()
Reinitialize to the unit matrix


transform

public void transform(double[] x,
                      double[] y,
                      double[] z,
                      int[] tx,
                      int[] ty,
                      int[] tz)
Transform nvert points from v into tv. v contains the input coordinates in floating point. Three successive entries in the array constitute a point. tv ends up holding the transformed points as integers; three successive entries per point


transform

public void transform(double[][] x,
                      double[][] y,
                      double[][] z,
                      int[][] tx,
                      int[][] ty,
                      int[][] tz)
Transform nvert points from v into tv. v contains the input coordinates in floating point. Three successive entries in the array constitute a point. tv ends up holding the transformed points as integers; three successive entries per point


transform

public java.awt.Point transform(double x,
                                double y,
                                double z)

FOOTER

BOTTOM