org.openmali.number.matrix
Class Matrix4rad

java.lang.Object
  extended by org.openmali.number.matrix.MatrixMxNrad
      extended by org.openmali.number.matrix.Matrix4rad
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class Matrix4rad
extends MatrixMxNrad
implements java.io.Externalizable

Represenents a spatial transformation.

The underlying number representation is radical1. This allows classic trigonomic constants to be explicitly represented (such as sqrt(2)/2). You can completely avoid floating point rounding issues for very speacial cases of geometry. The motivation for this functionality was angles of 30,45,60 degrees which naturally cancel during use (on a plane)

See Also:
Serialized Form

Field Summary
static Matrix4rad IDENTITY
           
 
Fields inherited from class org.openmali.number.matrix.MatrixMxNrad
colSkip, dataBegin, values
 
Constructor Summary
  Matrix4rad()
          Constructs and initializes a Matrix4f to all zeros.
protected Matrix4rad(boolean readOnly)
          For use caclulating redundant values of 3x3 rotation matrices ans = 1 - e1^2 + e2^2
  Matrix4rad(Tuple3rad translation, Matrix3rad rotation)
           
 
Method Summary
 Matrix4rad clone()
          
 Radical1 determinant()
           
 boolean epsilonEquals(Matrix4f other, float e)
          numerically tests whether they are approximately the same
 Matrix3rad getRotation(Matrix3rad passback)
           
 Tuple3rad getTranslation(Tuple3rad passback)
           
 void invert()
          this invert function inverts the matrix.
 void invert(Matrix4rad toInvert)
          sets this object to be the inverse of the argument
 Radical1 m00(Radical1 passback)
           
 Radical1 m00R()
           
 Radical1 m01(Radical1 passback)
           
 Radical1 m01R()
           
 Radical1 m02(Radical1 passback)
           
 Radical1 m02R()
           
 Radical1 m03(Radical1 passback)
           
 Radical1 m03R()
           
 Radical1 m10(Radical1 passback)
           
 Radical1 m10R()
           
 Radical1 m11(Radical1 passback)
           
 Radical1 m11R()
           
 Radical1 m12(Radical1 passback)
           
 Radical1 m12R()
           
 Radical1 m13(Radical1 passback)
           
 Radical1 m13R()
           
 Radical1 m20(Radical1 passback)
           
 Radical1 m20R()
           
 Radical1 m21(Radical1 passback)
           
 Radical1 m21R()
           
 Radical1 m22(Radical1 passback)
           
 Radical1 m22R()
           
 Radical1 m23(Radical1 passback)
           
 Radical1 m23R()
           
 Radical1 m30(Radical1 passback)
           
 Radical1 m30R()
           
 Radical1 m31(Radical1 passback)
           
 Radical1 m31R()
           
 Radical1 m32(Radical1 passback)
           
 Radical1 m32R()
           
 Radical1 m33(Radical1 passback)
           
 Radical1 m33R()
           
static Matrix4rad mul(Matrix4rad op1, Matrix4rad op2, Matrix4rad result)
           
static Matrix4rad newReadOnly()
          Constructs and initializes a Matrix4f to all zeros.
static Matrix4rad parseMatrix4rad(java.lang.String str)
           
 void readExternal(java.io.ObjectInput in)
           
 void setRotation(Matrix3rad rot)
           
 void setTranslation(Tuple3rad d)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.openmali.number.matrix.MatrixMxNrad
add, add, add, copySubMatrix, equals, equals, get, getColumn, getNumCols, getNumRows, getReference, getRow, getSharedSubMatrix, getSharedSubMatrix, hashCode, isDirty, isReadOnly, isSquare, isSubMatrix, mul, mul, mul, mul, mulTransposeBoth, mulTransposeLeft, negate, negate, newReadOnly, newReadOnly, newReadOnly, set, set, setClean, setColumn, setIdentity, setReference, setZero, sharedSubMatrixMxNrad, sharedSubMatrixMxNrad, sub, sub, sub, toString, transpose, transpose
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTITY

public static final Matrix4rad IDENTITY
Constructor Detail

Matrix4rad

protected Matrix4rad(boolean readOnly)
For use caclulating redundant values of 3x3 rotation matrices ans = 1 - e1^2 + e2^2


Matrix4rad

public Matrix4rad()
Constructs and initializes a Matrix4f to all zeros.


Matrix4rad

public Matrix4rad(Tuple3rad translation,
                  Matrix3rad rotation)
Method Detail

m00

public Radical1 m00(Radical1 passback)

m01

public final Radical1 m01(Radical1 passback)

m02

public final Radical1 m02(Radical1 passback)

m03

public final Radical1 m03(Radical1 passback)

m10

public final Radical1 m10(Radical1 passback)

m11

public final Radical1 m11(Radical1 passback)

m12

public final Radical1 m12(Radical1 passback)

m13

public final Radical1 m13(Radical1 passback)

m20

public final Radical1 m20(Radical1 passback)

m21

public final Radical1 m21(Radical1 passback)

m22

public final Radical1 m22(Radical1 passback)

m23

public final Radical1 m23(Radical1 passback)

m30

public final Radical1 m30(Radical1 passback)

m31

public final Radical1 m31(Radical1 passback)

m32

public final Radical1 m32(Radical1 passback)

m33

public final Radical1 m33(Radical1 passback)

m00R

public Radical1 m00R()

m01R

public final Radical1 m01R()

m02R

public final Radical1 m02R()

m03R

public final Radical1 m03R()

m10R

public final Radical1 m10R()

m11R

public final Radical1 m11R()

m12R

public final Radical1 m12R()

m13R

public final Radical1 m13R()

m20R

public final Radical1 m20R()

m21R

public final Radical1 m21R()

m22R

public final Radical1 m22R()

m23R

public final Radical1 m23R()

m30R

public final Radical1 m30R()

m31R

public final Radical1 m31R()

m32R

public final Radical1 m32R()

m33R

public final Radical1 m33R()

setRotation

public void setRotation(Matrix3rad rot)

getRotation

public Matrix3rad getRotation(Matrix3rad passback)

setTranslation

public void setTranslation(Tuple3rad d)

getTranslation

public Tuple3rad getTranslation(Tuple3rad passback)

mul

public static Matrix4rad mul(Matrix4rad op1,
                             Matrix4rad op2,
                             Matrix4rad result)

epsilonEquals

public boolean epsilonEquals(Matrix4f other,
                             float e)
numerically tests whether they are approximately the same

Parameters:
other -
e -
Returns:

clone

public Matrix4rad clone()
Description copied from class: MatrixMxNrad

Overrides:
clone in class MatrixMxNrad

determinant

public final Radical1 determinant()

invert

public final void invert()
this invert function inverts the matrix. This only works for the special case when the determinent is 1 i.e. there is no scaling representated by this transformation. This is true for rotation & translation and combinations thereof matrices. (our representation of radical1 can't divide by radicals, so we can't rescale)


invert

public final void invert(Matrix4rad toInvert)
sets this object to be the inverse of the argument

Parameters:
toInvert -

parseMatrix4rad

public static Matrix4rad parseMatrix4rad(java.lang.String str)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

newReadOnly

public static Matrix4rad newReadOnly()
Constructs and initializes a Matrix4f to all zeros.