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 RotationMatrix
Derives aRotationMatrix
that can be applied to rotate an entity anti-clockwise to the current orientation.abstract boolean
Derives aRotationMatrix
that can be applied to rotate an entity anti-clockwise to the current orientation.abstract int
hashCode()
abstract Orientation
negative()
Derives a newOrientation
in the opposite (negative) direction to the current instance.abstract int
The dimensionality of space the orientation is valid for.
-
Constructor Details
-
Orientation
public Orientation()
-
-
Method Details
-
getRotationMatrix
Derives aRotationMatrix
that 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 aRotationMatrix
that 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 newOrientation
in 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
Orientation
in the negative direction.
-