Class Rotater
- All Implemented Interfaces:
Serializable
,Component
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd an additional rotation to the current rotation.Get a description of the componentprotected int
Get the input dimension to a Rotaterdouble[][]
Return the double coefficients for the matrixgetName()
Get the name of the componentprotected int
Get the output dimension to a Rotaterinverse()
This isn't really right...boolean
isInverse
(Transformer trans) Is this the inverse rotation?void
printOut()
Debug outputvoid
transform
(double[] in, double[] out) Multiple a vector by the matrix.Get the transpose of the Matrix.Methods inherited from class skyview.geometry.Transformer
transform, transform
-
Constructor Details
-
Rotater
Create a matrix from input data. Each row should have the same number of elements but this is not checked. The user may enter a matrix that is not a rotation matrix.- Throws:
TransformationException
-
Rotater
Form a rotation from the Euler angles - three successive rotations about specified Cartesian axesA rotation is positive when the reference frame rotates anticlockwise as seen looking towards the origin from the positive region of the specified axis.
The characters of ORDER define which axes the three successive rotations are about. A typical value is 'ZXZ', indicating that RMAT is to become the direction cosine matrix corresponding to rotations of the reference frame through PHI radians about the old Z-axis, followed by THETA radians about the resulting X-axis, then PSI radians about the resulting Z-axis.
The axis names can be any of the following, in any order or combination: X, Y, Z, uppercase or lowercase, 1, 2, 3. Normal axis labelling/numbering conventions apply; the xyz (=123) triad is right-handed. Thus, the 'ZXZ' example given above could be written 'zxz' or '313' (or even 'ZxZ' or '3xZ'). ORDER is terminated by length or by the first unrecognized character.
Fewer than three rotations are acceptable, in which case the later angle arguments are ignored. If all rotations are zero, the identity matrix is produced.
- Parameters:
order
- specifies about which axes the rotations occurphi
- 1st rotation (radians)theta
- 2nd rotation ( " )psi
- 3rd rotation ( " )
-
-
Method Details
-
getInputDimension
protected int getInputDimension()Get the input dimension to a Rotater- Specified by:
getInputDimension
in classTransformer
-
getOutputDimension
protected int getOutputDimension()Get the output dimension to a Rotater- Specified by:
getOutputDimension
in classTransformer
-
getName
Get the name of the component -
getDescription
Get a description of the component- Specified by:
getDescription
in interfaceComponent
-
getMatrix
public double[][] getMatrix()Return the double coefficients for the matrix -
transpose
Get the transpose of the Matrix. For rotation matrices, the transpose is the inverse. This uses a create-on-demand protocol which creates the transpose matrix on the first transpose call and simply returns the reference in later calls. -
inverse
This isn't really right... We should check this is a rotation matrix better!- Specified by:
inverse
in classTransformer
-
add
Add an additional rotation to the current rotation. The current rotation is applied first, and then the additional rotation. This is equivalent to multiply the old matrix by the new matrix with new matrix on the left. -
transform
public void transform(double[] in, double[] out) Multiple a vector by the matrix.- Specified by:
transform
in classTransformer
- Parameters:
in
- The input vector.out
- The output vector, it may be the same as the input vector if the dimensionalities are the same. All transformers are expected to work with aliased inputs and output.
-
isInverse
Is this the inverse rotation?- Specified by:
isInverse
in classTransformer
-
printOut
public void printOut()Debug output
-