bijnum
Class BIJtransform

java.lang.Object
  |
  +--bijnum.BIJtransform

public class BIJtransform
extends java.lang.Object

This class implements static transformation matrix operations for 2-D and 3-D transformation matrices. Interface leans heavily on Foley, van Dam. Computer Graphics. Second ed. Homogenuous coordinate systems. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Constructor Summary
BIJtransform()
           
 
Method Summary
protected static double clean(double d)
           
static float[][] newMatrix(int dimensions)
          Create a new (diagonal) transformation matrix for the number of dimensions.
static float[][] rotatex(float[][] m, double theta)
          Rotate a transformation matrix around the x-axis.
static float[][] rotatey(float[][] m, double theta)
          Rotate a transformation matrix around the y axis.
static float[][] rotatez(float[][] m, double theta)
          Rotate a transformation matrix around the z axis.
static float[][] scale(float[][] m, double sx, double sy)
          Scale a 2-D transformation matrix by sx, sy.
static float[][] scale(float[][] m, double sx, double sy, double sz)
          Scale a 3-D transformation matrix by sx, sy, sz.
static float[][] translate(float[][] m, double tx, double ty)
          Translate a 2-D transformation matrix by these values.
static float[][] translate(float[][] m, double tx, double ty, double tz)
          Translate a 3-D transformation matrix by these values.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BIJtransform

public BIJtransform()
Method Detail

newMatrix

public static float[][] newMatrix(int dimensions)
Create a new (diagonal) transformation matrix for the number of dimensions. Matrix will be one larger because we need a homogenuous coordinate system.

translate

public static float[][] translate(float[][] m,
                                  double tx,
                                  double ty,
                                  double tz)
Translate a 3-D transformation matrix by these values.
Parameters:
m - the transformation matrix
tx,ty,tz - the amounts to translate on each of the axes.
Returns:
a new, transformed matrix.

translate

public static float[][] translate(float[][] m,
                                  double tx,
                                  double ty)
Translate a 2-D transformation matrix by these values.
Parameters:
m - the transformation matrix
tx,ty - the amounts to translate on each of the axes.
Returns:
a new, transformed matrix.

scale

public static float[][] scale(float[][] m,
                              double sx,
                              double sy,
                              double sz)
Scale a 3-D transformation matrix by sx, sy, sz.
Parameters:
m - the transformation matrix
sx,sy,sz - the amounts to scale by on each of the axes.
Returns:
a new, transformed matrix.

scale

public static float[][] scale(float[][] m,
                              double sx,
                              double sy)
Scale a 2-D transformation matrix by sx, sy.
Parameters:
m - the transformation matrix
sx,sy - the amounts to scale by on each of the axes.
Returns:
a new, transformed matrix.

rotatex

public static float[][] rotatex(float[][] m,
                                double theta)
Rotate a transformation matrix around the x-axis. I dont think you can rotate a 2-D image about the x-axis.
Parameters:
m - the transformation matrix
theta - the amount to rotate (in degrees)
Returns:
a new, transformed matrix.

rotatey

public static float[][] rotatey(float[][] m,
                                double theta)
Rotate a transformation matrix around the y axis. I dont think you can rotate a 2-D image about the y-axis.
Parameters:
m - the transformation matrix
theta - the amount to rotate (in degrees)
Returns:
a new, transformed matrix.

rotatez

public static float[][] rotatez(float[][] m,
                                double theta)
Rotate a transformation matrix around the z axis. I dont think you can rotate a 2-D image about the z-axis.
Parameters:
m - the transformation matrix
theta - the amount to rotate (in degrees)
Returns:
a new, transformed matrix.

clean

protected static double clean(double d)