Class pmr.euclid.Transform2
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.euclid.Transform2

java.lang.Object
   |
   +----pmr.euclid.Status
           |
           +----pmr.euclid.RealMatrix
                   |
                   +----pmr.euclid.RealSquareMatrix
                           |
                           +----pmr.euclid.Transform2

public class Transform2
extends RealSquareMatrix
Transform2 - 2-D transformation matrix class

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


TRFORM2_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.

NOTE; this has been hacked in a hurry from Transform3. Many of the internal routines are grossly overcomplicated. I'll clean it up some time.

Author:
(C) P. Murray-Rust, 1996

Variable Index

 o ROT_ORIG
 o ROT_TRANS
 o ROT_TRANS_AXIAL_SCALE
 o ROT_TRANS_SCALE
 o ROT_TRANS_SCALE_PERSP
 o TRFORM3_ANY
 o TRFORM3_NULL

Constructor Index

 o Transform2()
default is a unit matrix
 o Transform2(Angle)
rotation about z- axis
 o Transform2(double[])
Formed by feeding in an existing array to a cols*cols matrix.
 o Transform2(int)
This gives a default unit matrix of type t (default ROT_ORIG).
 o Transform2(Real2, Real2)
from 2 vector components - NOT checked for validity
 o Transform2(RealSquareMatrix)
from a 2x2 or 3x3 matrix
 o Transform2(RealSquareMatrix, Vector2)
from a 2x2 rotation matrix and a translation vector
 o Transform2(Transform2)
copy constructors - assumed to be an OK matrix
 o Transform2(Transform2, Real2)
from rotation about a point, given a matrix NOT CHECKED
 o Transform2(Vector2)
identity matrix with translation component
 o Transform2(Vector2, Vector2)
rotation of one vector onto another

Method Index

 o checkMatrix()
get new matrix type
 o clone(Transform2)
clone
 o concatenate(Transform2)
concatenate
 o equals(Transform2)
 o flipAboutVector(Real2)
get Transformation to mirror ('flip') across an axis NOT YET CHECKED
 o getAngleOfRotation()
interpret current matrix as rotation about axis NOT YET CHECKED; only worsk for orthornormal matrices
 o getCentreOfRotation()
get centre of rotation
 o getRotationMatrix()
get Unitary matrix (i.e.
 o getTransformationType()
get transformation type
 o getTranslation()
get translation component only
 o main(String[])
tests Transform2 routines
 o setTransformationType(int)
set transformation type
 o toString()
output matrix - very crude...

Variables

 o TRFORM3_NULL
  public final static int TRFORM3_NULL
 o ROT_ORIG
  public final static int ROT_ORIG
 o ROT_TRANS
  public final static int ROT_TRANS
 o ROT_TRANS_SCALE
  public final static int ROT_TRANS_SCALE
 o ROT_TRANS_AXIAL_SCALE
  public final static int ROT_TRANS_AXIAL_SCALE
 o ROT_TRANS_SCALE_PERSP
  public final static int ROT_TRANS_SCALE_PERSP
 o TRFORM3_ANY
  public final static int TRFORM3_ANY

Constructors

 o Transform2
  public Transform2()
default is a unit matrix
 o Transform2
  public Transform2(int t)
This gives a default unit matrix of type t (default ROT_ORIG).
 o Transform2
  public Transform2(Vector2 v)
identity matrix with translation component
 o Transform2
  public Transform2(Angle zrot)
rotation about z- axis
 o Transform2
  public Transform2(Transform2 t,
                    Real2 p)
from rotation about a point, given a matrix NOT CHECKED
 o Transform2
  public Transform2(Vector2 v1,
                    Vector2 v2) throws ZeroLengthVectorException
rotation of one vector onto another
Throws: ZeroLengthVectorException
v1 or v2 is zero length
 o Transform2
  public Transform2(Real2 v1,
                    Real2 v2)
from 2 vector components - NOT checked for validity
 o Transform2
  public Transform2(double array[]) throws InvalidArgumentException
Formed by feeding in an existing array to a cols*cols matrix. array is or type m00, m01, m02, m10 ...
Throws: InvalidArgumentException
array must have 9 elements
 o Transform2
  public Transform2(Transform2 m)
copy constructors - assumed to be an OK matrix
 o Transform2
  public Transform2(RealSquareMatrix m) throws UnequalLengthArraysException
from a 2x2 or 3x3 matrix
Throws: UnequalLengthArraysException
m must be 2*2 or 3*3
 o Transform2
  public Transform2(RealSquareMatrix m,
                    Vector2 v) throws UnequalLengthArraysException
from a 2x2 rotation matrix and a translation vector
Throws: UnequalLengthArraysException
m must be 2*2

Methods

 o clone
  public Transform2 clone(Transform2 m)
clone
 o equals
  public boolean equals(Transform2 m)
 o concatenate
  public Transform2 concatenate(Transform2 m2)
concatenate
 o setTransformationType
  public int setTransformationType(int option)
set transformation type
 o getTransformationType
  public int getTransformationType()
get transformation type
 o checkMatrix
  public int checkMatrix()
get new matrix type
 o getAngleOfRotation
  public Angle getAngleOfRotation()
interpret current matrix as rotation about axis NOT YET CHECKED; only worsk for orthornormal matrices
 o flipAboutVector
  public static Transform2 flipAboutVector(Real2 r) throws ZeroLengthVectorException
get Transformation to mirror ('flip') across an axis NOT YET CHECKED
Throws: ZeroLengthVectorException
r is zero length
 o getTranslation
  public Real2 getTranslation()
get translation component only
 o getCentreOfRotation
  public Point3 getCentreOfRotation() throws UnimplementedException
get centre of rotation
Throws: UnimplementedException
NOT YET WORKING
 o getRotationMatrix
  public RealSquareMatrix getRotationMatrix()
get Unitary matrix (i.e. eliminate scales and translation)
 o toString
  public String toString()
output matrix - very crude...
Overrides:
toString in class RealMatrix
 o main
  public static void main(String args[])
tests Transform2 routines

All Packages  Class Hierarchy  This Package  Previous  Next  Index