# Class Rotation

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.Rotation

@Equality public abstract class Rotation extends Object
Rotates vectors between sky systems.

Since:
  20 Apr 2016
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static Rotation`
`IDENTITY`
Identity rotation; the rotate method is a no-op.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Rotation()`
Protected no-arg constructor of abstract class.

## Method Summary

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.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### IDENTITY

public static Rotation IDENTITY
Identity rotation; the rotate method is a no-op.

## Constructor Details

### Rotation

protected Rotation()
Protected no-arg constructor of abstract class.

## Method Details

### 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 null
  `outSys` - 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 null
  `outSys` - output sky system; may be null
Returns:
  rotation from input to output sky systems, not null