Class Orientation
Object
Orientation
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Orientation2D,Orientation3DEulerAngles,OrientationAxisAngle,OrientationRotationMatrix
The orientation (direction) in
2D or 3D Euclidean space.
It presumes the existing entity has a neutral orientation along the x-axis.
All implementations must be immutable classes, whose state cannot be changed.
As an exception, we have internal state to memoize calls to deriveRotationMatrix().
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RotationMatrixDerives aRotationMatrixthat can be applied to rotate an entity anti-clockwise to the current orientation.abstract booleanDerives aRotationMatrixthat can be applied to rotate an entity anti-clockwise to the current orientation.abstract inthashCode()abstract Orientationnegative()Derives a newOrientationin the opposite (negative) direction to the current instance.abstract intThe dimensionality of space the orientation is valid for.
-
Constructor Details
-
Orientation
public Orientation()
-
-
Method Details
-
getRotationMatrix
Derives aRotationMatrixthat can be applied to rotate an entity anti-clockwise to the current orientation.It presumes the existing entity has a neutral orientation along the x-axis.
This computation is memoized, upon the first call to this method.
- Returns:
- the rotation-matrix.
-
deriveRotationMatrix
Derives aRotationMatrixthat can be applied to rotate an entity anti-clockwise to the current orientation.It presumes the existing entity has a neutral orientation along the x-axis.
- Returns:
- the rotation-matrix.
-
numberDimensions
public abstract int numberDimensions()The dimensionality of space the orientation is valid for.- Returns:
- 2 or 3.
-
equals
-
hashCode
public abstract int hashCode() -
negative
Derives a newOrientationin the opposite (negative) direction to the current instance.A unit step from the origin in the current orientation direction, summed with a unit step in the negative direction, should end in the origin.
- Returns:
- the new
Orientationin the negative direction.
-