org.jscience.chemistry.gui.extended.molecule
Class Matrix3D

java.lang.Object
  extended by org.jscience.chemistry.gui.extended.molecule.Matrix3D
All Implemented Interfaces:
java.lang.Cloneable

public class Matrix3D
extends java.lang.Object
implements java.lang.Cloneable

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


Field Summary
 float xo
          DOCUMENT ME!
 float xscale
          DOCUMENT ME!
 float xx
          DOCUMENT ME!
 float xy
          DOCUMENT ME!
 float xz
          DOCUMENT ME!
 float yo
          DOCUMENT ME!
 float yscale
          DOCUMENT ME!
 float yx
          DOCUMENT ME!
 float yy
          DOCUMENT ME!
 float yz
          DOCUMENT ME!
 float zo
          DOCUMENT ME!
 float zscale
          DOCUMENT ME!
 float zx
          DOCUMENT ME!
 float zy
          DOCUMENT ME!
 float zz
          DOCUMENT ME!
 
Constructor Summary
Matrix3D()
          Create a new unit matrix
 
Method Summary
 java.lang.Object clone()
          Returns a clone (Object) of matrix
 float getXScale()
          Returns X scale
 float getYScale()
          Returns Y scale
 float getZScale()
          Returns Z scale
 void mult(Matrix3D rhs)
          Multiply this matrix by a second: M = MR
 void scale(float f)
          Scale by f in all dimensions
 void scale(float xf, float yf, float zf)
          Scale along each axis independently
 java.lang.String toString()
          DOCUMENT ME!
 void transform(AtomVector av, int nvert)
          Transform first nvert Atoms in AtomVector
 void transform(double[] x, double[] y, double[] z, double[] tx, double[] ty, double[] tz, int nvert)
          Transform first nvert points from x,y and z into tx,ty and tz.
 void transform(float[] x, float[] y, float[] z, float[] tx, float[] ty, float[] tz, int nvert)
          Transform first nvert points from x,y and z into tx,ty and tz.
 void transform(float[] v, float[] tv, int nvert)
          Transform last nvert points from v into tv.
 void transform(float[] v, int[] tv, int nvert)
          Transform last nvert points from v into tv.
 void transform(Molecule jmol)
          Transform everything appropriate in the molecule
 void translate(float x, float y, float 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xx

public float xx
DOCUMENT ME!


xy

public float xy
DOCUMENT ME!


xz

public float xz
DOCUMENT ME!


xo

public float xo
DOCUMENT ME!


yx

public float yx
DOCUMENT ME!


yy

public float yy
DOCUMENT ME!


yz

public float yz
DOCUMENT ME!


yo

public float yo
DOCUMENT ME!


zx

public float zx
DOCUMENT ME!


zy

public float zy
DOCUMENT ME!


zz

public float zz
DOCUMENT ME!


zo

public float zo
DOCUMENT ME!


xscale

public float xscale
DOCUMENT ME!


yscale

public float yscale
DOCUMENT ME!


zscale

public float zscale
DOCUMENT ME!

Constructor Detail

Matrix3D

public Matrix3D()
Create a new unit matrix

Method Detail

clone

public java.lang.Object clone()
Returns a clone (Object) of matrix

Overrides:
clone in class java.lang.Object
Returns:
DOCUMENT ME!

scale

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

Parameters:
f - DOCUMENT ME!

scale

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

Parameters:
xf - DOCUMENT ME!
yf - DOCUMENT ME!
zf - DOCUMENT ME!

getXScale

public float getXScale()
Returns X scale

Returns:
DOCUMENT ME!

getYScale

public float getYScale()
Returns Y scale

Returns:
DOCUMENT ME!

getZScale

public float getZScale()
Returns Z scale

Returns:
DOCUMENT ME!

translate

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

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
z - DOCUMENT ME!

yrot

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

Parameters:
theta - DOCUMENT ME!

xrot

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

Parameters:
theta - DOCUMENT ME!

zrot

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

Parameters:
theta - DOCUMENT ME!

mult

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

Parameters:
rhs - DOCUMENT ME!

unit

public void unit()
Reinitialize to the unit matrix


transform

public void transform(float[] v,
                      int[] tv,
                      int nvert)
Transform last 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.

Parameters:
v - DOCUMENT ME!
tv - DOCUMENT ME!
nvert - DOCUMENT ME!

transform

public void transform(float[] v,
                      float[] tv,
                      int nvert)
Transform last 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 floating point; three successive entries per point.

Parameters:
v - DOCUMENT ME!
tv - DOCUMENT ME!
nvert - DOCUMENT ME!

transform

public void transform(double[] x,
                      double[] y,
                      double[] z,
                      double[] tx,
                      double[] ty,
                      double[] tz,
                      int nvert)
Transform first nvert points from x,y and z into tx,ty and tz. x,y and z contains the input coordinates in double. tx,ty and tz end up holding the transformed points as double.

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
z - DOCUMENT ME!
tx - DOCUMENT ME!
ty - DOCUMENT ME!
tz - DOCUMENT ME!
nvert - DOCUMENT ME!

transform

public void transform(float[] x,
                      float[] y,
                      float[] z,
                      float[] tx,
                      float[] ty,
                      float[] tz,
                      int nvert)
Transform first nvert points from x,y and z into tx,ty and tz. x,y and z contains the input coordinates in floating point. tx,ty and tz end up holding the transformed points as floating point.

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
z - DOCUMENT ME!
tx - DOCUMENT ME!
ty - DOCUMENT ME!
tz - DOCUMENT ME!
nvert - DOCUMENT ME!

transform

public void transform(AtomVector av,
                      int nvert)
Transform first nvert Atoms in AtomVector

Parameters:
av - DOCUMENT ME!
nvert - DOCUMENT ME!

transform

public void transform(Molecule jmol)
Transform everything appropriate in the molecule

Parameters:
jmol - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!