Class Orientation2D
Object
Orientation
Orientation2D
- All Implemented Interfaces:
Serializable
A simple angular orientation the 2D plane, relative to the x-axis.
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected RotationMatrixDerives aRotationMatrixthat can be applied to rotate an entity anti-clockwise to the current orientation.booleandoubleThe angle of the rotation in the 2D plane anti-clockwise, in degrees.inthashCode()negative()Derives a newOrientationin the opposite (negative) direction to the current instance.intThe dimensionality of space the orientation is valid for.toString()Methods inherited from class org.anchoranalysis.spatial.orientation.Orientation
getRotationMatrix
-
Constructor Details
-
Orientation2D
public Orientation2D(double angleRadians) Creates a newOrientation2Dinstance.- Parameters:
angleRadians- The angle of the rotation in the 2D plane anti-clockwise, in radians.
-
Orientation2D
public Orientation2D()
-
-
Method Details
-
getAngleDegrees
public double getAngleDegrees()The angle of the rotation in the 2D plane anti-clockwise, in degrees.- Returns:
- the angle in degrees.
-
negative
Description copied from class:OrientationDerives 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.
- Specified by:
negativein classOrientation- Returns:
- the new
Orientationin the negative direction.
-
deriveRotationMatrix
Description copied from class:OrientationDerives 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.
- Specified by:
deriveRotationMatrixin classOrientation- Returns:
- the rotation-matrix.
-
toString
-
numberDimensions
public int numberDimensions()Description copied from class:OrientationThe dimensionality of space the orientation is valid for.- Specified by:
numberDimensionsin classOrientation- Returns:
- 2 or 3.
-
equals
- Specified by:
equalsin classOrientation
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCodein classOrientation
-