subscript.geom
Class AxisAngle

java.lang.Object
  extended by subscript.geom.AxisAngle

public class AxisAngle
extends java.lang.Object

Represents a 3D rotation. A companion class to Quaternion.


Field Summary
 double theta
           
 double x
           
 double y
           
 double z
           
 
Constructor Summary
AxisAngle(double x, double y, double z, double theta)
          Create from a vector (which will be normalized) and a rotation amount.
AxisAngle(Matrix R)
          Create from a 3x3 rotation matrix.
AxisAngle(Quaternion q)
          Create from a quaternion.
 
Method Summary
 void normalize()
          Ensure that the unit vector is actually a unit vector.
 void scaleRotation(double amt)
          Scale the amount of rotation by the given factor.
 java.lang.String toString()
           
 Matrix transformationMatrix()
          Convert to a 3x3 rotation matrix.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y

z

public double z

theta

public double theta
Constructor Detail

AxisAngle

public AxisAngle(Matrix R)
Create from a 3x3 rotation matrix.


AxisAngle

public AxisAngle(Quaternion q)
Create from a quaternion.


AxisAngle

public AxisAngle(double x,
                 double y,
                 double z,
                 double theta)
Create from a vector (which will be normalized) and a rotation amount.

Method Detail

scaleRotation

public void scaleRotation(double amt)
Scale the amount of rotation by the given factor.


normalize

public void normalize()
Ensure that the unit vector is actually a unit vector.


transformationMatrix

public Matrix transformationMatrix()
Convert to a 3x3 rotation matrix.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object