jumbo.euclid
Class Transform3

java.lang.Object
  |
  +--jumbo.euclid.Status
        |
        +--jumbo.euclid.RealMatrix
              |
              +--jumbo.euclid.RealSquareMatrix
                    |
                    +--jumbo.euclid.Transform3

public class Transform3
extends RealSquareMatrix

Transform3 - 3-D transformation matrix class

Transform3 represents a transformation matrix for 3-D objects. Its actual form may be implementation-dependent, but we have started with 4x4 matrices. The following transformations will be supported as the class is developed:


TRFORM3_NULL no transformation allowed
ROT_ORIG rotation about the origin
ROT_TRANS rotation and translation
ROT_TRANS_SCALE rotation, translation and single scale factor
ROT_TRANS_AXIAL_SCALE rotation, translation + 3 axial scale factors
ROT_TRANS_SCALE_PERSP rotation, translation, scale, perspective
TRFORM3_ANY any matrix at all - user beware!

The basic stuff is all there - the user will do best to look at examples.


Field Summary
static int ROT_ORIG
           
static int ROT_TRANS
           
static int ROT_TRANS_AXIAL_SCALE
           
static int ROT_TRANS_SCALE
           
static int ROT_TRANS_SCALE_PERSP
           
static int TRFORM3_ANY
           
static int TRFORM3_NULL
           
 
Fields inherited from class jumbo.euclid.RealMatrix
cols, flmat, rows
 
Constructor Summary
Transform3()
          default is a unit matrix
Transform3(Angle xrot, Angle yrot, Angle zrot)
          from rotation about the three orthogonal axes (X then Y then Z)
Transform3(Choice3 axis, Angle rot)
          from rotation about an axis (use (Choice3.X), etc.
Transform3(double[] array)
          Formed by feeding in an existing array to a cols*cols matrix.
Transform3(int t)
          This gives a default unit matrix of type t (default ROT_ORIG).
Transform3(Line3 l, Angle a)
          Rotation about a line
Transform3(RealSquareMatrix m)
          from a 3x3 or 4x4 matrix
Transform3(RealSquareMatrix m, Vector3 v)
          from a 3x3 rotation matrix and a translation vector
Transform3(Transform3 m)
          copy constructors - assumed to be an OK matrix
Transform3(Transform3 t, Point3 p)
          from rotation about a point, given a matrix
Transform3(Vector3 v)
          identity matrix with translation component
Transform3(Vector3 v, Angle a)
          from rotation about a vector
Transform3(Vector3 v1, Vector3 v2)
          rotation of one vector onto another
Transform3(Vector3 v1, Vector3 v2, Vector3 v3)
          from 3 vector components - NOT checked
 
Method Summary
 int checkMatrix()
          get new matrix type
 Transform3 clone(Transform3 m)
          clone
 Transform3 concatenate(Transform3 m2)
          concatenate
 boolean equals(Transform3 m)
           
 int getAxisAndAngle(Vector3 axis, Angle ang)
          returns chirality
 Point3 getCentreOfRotation()
          get centre of rotation
 RealSquareMatrix getRotationMatrix()
          get Unitary matrix (i.e.
 int getTransformationType()
          get transformation type
 Vector3 getTranslation()
          get translation component only
static void main(java.lang.String[] args)
          tests Transform3 routines
 int setTransformationType(int option)
          set transformation type
 
Methods inherited from class jumbo.euclid.RealSquareMatrix
copyLowerToUpper, copyUpperToLower, determinant, diagonal, diagonaliseAndReturnRank, equals, getInverse, isImproperRotation, isLowerTriangular, isOrthogonal, isOrthonormal, isSymmetric, isUnit, isUnitary, isUpperTriangular, lowerTriangle, multiply, orthogonalise, orthonormalise, outerProduct, plus, shallowCopy, subtract, trace, transpose
 
Methods inherited from class jumbo.euclid.RealMatrix
appendColumnData, appendColumnData, appendRowData, appendRowData, clearMatrix, clone, columnwiseDivide, deleteColumn, deleteColumns, deleteRow, deleteRows, elementAt, elementAt, elementsInRange, equals, euclideanColumnLength, euclideanColumnLengths, euclideanRowLength, euclideanRowLengths, extractColumnData, extractRowData, extractSubMatrixData, getCols, getMatrix, getMatrixAsArray, getRows, getTranspose, indexOfLargestElement, indexOfLargestElementInColumn, indexOfLargestElementInRow, indexOfSmallestElement, indexOfSmallestElementInColumn, indexOfSmallestElementInRow, insertColumnData, insertColumnData, insertColumns, insertRowData, insertRowData, insertRows, isSquare, largestElement, largestElementInColumn, largestElementInRow, multiply, multiply, multiplyBy, negative, normaliseByColumns, normaliseByRows, plus, reorderColumnsBy, reorderRowsBy, replaceColumnData, replaceColumnData, replaceColumnData, replaceRowData, replaceRowData, replaceRowData, replaceSubMatrixData, setAllElements, setElementAt, shallowCopy, smallestElement, smallestElementInColumn, smallestElementInRow, subtract, toString
 
Methods inherited from class jumbo.euclid.Status
NYI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRFORM3_NULL

public static final int TRFORM3_NULL

ROT_ORIG

public static final int ROT_ORIG

ROT_TRANS

public static final int ROT_TRANS

ROT_TRANS_SCALE

public static final int ROT_TRANS_SCALE

ROT_TRANS_AXIAL_SCALE

public static final int ROT_TRANS_AXIAL_SCALE

ROT_TRANS_SCALE_PERSP

public static final int ROT_TRANS_SCALE_PERSP

TRFORM3_ANY

public static final int TRFORM3_ANY
Constructor Detail

Transform3

public Transform3()
default is a unit matrix

Transform3

public Transform3(int t)
This gives a default unit matrix of type t (default ROT_ORIG).

Transform3

public Transform3(Vector3 v)
identity matrix with translation component

Transform3

public Transform3(Choice3 axis,
                  Angle rot)
from rotation about an axis (use (Choice3.X), etc.

Transform3

public Transform3(Angle xrot,
                  Angle yrot,
                  Angle zrot)
from rotation about the three orthogonal axes (X then Y then Z)

Transform3

public Transform3(Transform3 t,
                  Point3 p)
from rotation about a point, given a matrix

Transform3

public Transform3(Vector3 v,
                  Angle a)
from rotation about a vector

Transform3

public Transform3(Line3 l,
                  Angle a)
Rotation about a line

Transform3

public Transform3(Vector3 v1,
                  Vector3 v2)
           throws ZeroVectorException
rotation of one vector onto another
Throws:
ZeroVectorException - v1 or v2 is zero length

Transform3

public Transform3(Vector3 v1,
                  Vector3 v2,
                  Vector3 v3)
from 3 vector components - NOT checked

Transform3

public Transform3(double[] array)
           throws BadArgumentException
Formed by feeding in an existing array to a cols*cols matrix. array is or type m00, m01, m02, m03, m13 ...
Throws:
BadArgumentException - array must have 16 elements

Transform3

public Transform3(Transform3 m)
copy constructors - assumed to be an OK matrix

Transform3

public Transform3(RealSquareMatrix m)
           throws UnequalArraysException
from a 3x3 or 4x4 matrix
Throws:
UnequalArraysException - m must be 3*3 or 4*4

Transform3

public Transform3(RealSquareMatrix m,
                  Vector3 v)
           throws UnequalArraysException
from a 3x3 rotation matrix and a translation vector
Throws:
UnequalArraysException - m must be 3*3
Method Detail

clone

public Transform3 clone(Transform3 m)
clone

equals

public boolean equals(Transform3 m)

concatenate

public Transform3 concatenate(Transform3 m2)
concatenate

setTransformationType

public int setTransformationType(int option)
set transformation type

getTransformationType

public int getTransformationType()
get transformation type

checkMatrix

public int checkMatrix()
get new matrix type

getAxisAndAngle

public int getAxisAndAngle(Vector3 axis,
                           Angle ang)
returns chirality

getTranslation

public Vector3 getTranslation()
get translation component only

getCentreOfRotation

public Point3 getCentreOfRotation()
get centre of rotation

getRotationMatrix

public RealSquareMatrix getRotationMatrix()
get Unitary matrix (i.e. eliminate scales and translation)

main

public static void main(java.lang.String[] args)
tests Transform3 routines