org.dolben.iiid
Class R3

java.lang.Object
  extended by org.dolben.iiid.R3

public class R3
extends java.lang.Object

Cross product and rotation matrix generators for 3D.
The components of a 3D vector are { x, y, z }. The generated matrices are "active rotations", i.e., applying one to a vector results in a vector rotated by the given angle around the axis in the original coordinate system.


Constructor Summary
R3()
           
 
Method Summary
static double[] cross(double[] u, double[] v)
          Computes the cross product of two 3D vectors
static double[][] rotationX(double theta)
          Generates a 3D matix for a rotation by an angle around the x axis.
static double[][] rotationY(double theta)
          Generates a 3D matix for a rotation by an angle around the y axis.
static double[][] rotationZ(double theta)
          Generates a 3D matix for a rotation by an angle around the z axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

R3

public R3()
Method Detail

cross

public static double[] cross(double[] u,
                             double[] v)
Computes the cross product of two 3D vectors

Parameters:
u - one vector
v - another vector
Returns:
the cross product

rotationX

public static double[][] rotationX(double theta)
Generates a 3D matix for a rotation by an angle around the x axis.

Parameters:
theta - an angle
Returns:
the rotation matrix

rotationY

public static double[][] rotationY(double theta)
Generates a 3D matix for a rotation by an angle around the y axis.

Parameters:
theta - an angle
Returns:
the rotation matrix

rotationZ

public static double[][] rotationZ(double theta)
Generates a 3D matix for a rotation by an angle around the z axis.

Parameters:
theta - an angle
Returns:
the rotation matrix