org.scilab.forge.scirenderer.tranformations
Class Rotation

java.lang.Object
  extended by org.scilab.forge.scirenderer.tranformations.Rotation

public class Rotation
extends java.lang.Object

This class represent a Rotation. The data are stored as an unitary quaternion [a; b; c; d]. A rotation of an angle alpha along the vector [x; y; z] is stored thus : a = cos (alpha / 2) b = sin (alpha / 2) * nx c = sin (alpha / 2) * ny d = sin (alpha / 2) * nz Where [nx; ny; nz] is [x; y; z] / norm([x; y; z]).

Author:
Pierre Lando

Constructor Summary
Rotation()
          Default constructor.
Rotation(double[] v)
           
Rotation(double alpha, Vector3d v)
          The created object represent a rotation of an angle of 'alpha' radians along the vector 'v'.
Rotation(double alpha, Vector3f v)
          The created object represent a rotation of an angle of 'alpha' radians along the vector 'v'.
Rotation(float[] v)
           
Rotation(Rotation r)
          Copy constructor.
 
Method Summary
 Vector3d conjugate(Vector3d v)
           
 Vector3d conjugateInverse(Vector3d v)
           
 boolean equals(Rotation r2)
           
 double[] getData()
           
 float[] getDataAsFloatArray()
           
 Rotation getInverse()
          Return the inverse rotation.
 double[] getRotationMatrix()
           
 double[] getUnRotateMatrix()
           
 Vector3d getVectorY()
           
 int hashCode()
           
 boolean isIdentity()
          Return true if this object represents an identity transformation.
 Rotation multiply(Rotation q)
           
 Rotation power(double p)
           
 Rotation times(Rotation q)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rotation

public Rotation()
Default constructor. The created object represent identity rotation.


Rotation

public Rotation(Rotation r)
Copy constructor. The created object is a copy of the given rotation r.

Parameters:
r - the given rotation.

Rotation

public Rotation(double alpha,
                Vector3d v)
The created object represent a rotation of an angle of 'alpha' radians along the vector 'v'.

Parameters:
alpha - the rotation angle in radians.
v - the vector carrying the rotation.

Rotation

public Rotation(double alpha,
                Vector3f v)
The created object represent a rotation of an angle of 'alpha' radians along the vector 'v'.

Parameters:
alpha - the rotation angle in radians.
v - the vector carrying the rotation.

Rotation

public Rotation(float[] v)

Rotation

public Rotation(double[] v)
Method Detail

getInverse

public Rotation getInverse()
Return the inverse rotation.

Returns:
the inverse rotation.

isIdentity

public boolean isIdentity()
Return true if this object represents an identity transformation.

Returns:
true if this object represents an identity transformation.

getRotationMatrix

public double[] getRotationMatrix()

getUnRotateMatrix

public double[] getUnRotateMatrix()

multiply

public Rotation multiply(Rotation q)

times

public Rotation times(Rotation q)

conjugate

public Vector3d conjugate(Vector3d v)

conjugateInverse

public Vector3d conjugateInverse(Vector3d v)

toString

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

getVectorY

public Vector3d getVectorY()

power

public Rotation power(double p)

getData

public double[] getData()

getDataAsFloatArray

public float[] getDataAsFloatArray()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(Rotation r2)