Package uk.ac.starlink.ttools.plot2.geom
Class Rotation
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.geom.Rotation
-
@Equality public abstract class Rotation extends java.lang.Object
Rotates vectors between sky systems.- Since:
- 20 Apr 2016
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Rotation()
Protected no-arg constructor of abstract class.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Rotation
createRotation(SkySys inSys, SkySys outSys)
Returns a rotation instance that can transform between two submitted sky systems.abstract double[]
getMatrix()
Returns the 9-element matrix defining this rotation.abstract Rotation
invert()
Returns the inverse of this rotation.static boolean
isIdentityRotation(SkySys inSys, SkySys outSys)
Indicates whether the rotation between two sky systems is known to be an identity (no-op) transformation.abstract void
rotate(double[] r3)
Rotates a 3-vector in place.
-
-
-
Field Detail
-
IDENTITY
public static Rotation IDENTITY
Identity rotation; the rotate method is a no-op.
-
-
Method Detail
-
rotate
public abstract void rotate(double[] r3)
Rotates a 3-vector in place.- Parameters:
r3
- 3-element unit vector, changed on output
-
invert
public abstract Rotation invert()
Returns the inverse of this rotation.- Returns:
- inverse rotation
-
getMatrix
public abstract double[] getMatrix()
Returns the 9-element matrix defining this rotation.- Returns:
- 9-element rotation matrix
-
isIdentityRotation
public static boolean isIdentityRotation(SkySys inSys, SkySys outSys)
Indicates whether the rotation between two sky systems is known to be an identity (no-op) transformation. If either or both sky systems is null, it is assumed that no rotation is required.- Parameters:
inSys
- input sky system; may be nulloutSys
- output sky system; may be null- Returns:
- true iff no rotation operation is required
-
createRotation
public static Rotation createRotation(SkySys inSys, SkySys outSys)
Returns a rotation instance that can transform between two submitted sky systems.- Parameters:
inSys
- input sky system; may be nulloutSys
- output sky system; may be null- Returns:
- rotation from input to output sky systems, not null
-
-