Package net.algart.math.geom
Class Rotation2D
java.lang.Object
net.algart.math.geom.Rotation2D
- All Implemented Interfaces:
Cloneable
2D rotation by some angle: an immutable object representing some rotation angle Δφ. Positive Δφ corresponds to anticlockwise rotation.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
- Author:
- Daniel Alievsky
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns this instance (possible solution as this class is immutable).boolean
Indicates whether some other rotation is equal to this one, i.e. if the angle returned bygetRotationAngle()
is the same for both rotations.double
Returns cosine of the current rotation angle.static Rotation2D
Returns a rotation by Δφ = 0.static Rotation2D
getInstance
(double dfi) Creates a rotation by Δφ = dfi argument (in radians).double
Returns the current rotation angle (in radians).double
getSine()
Returns sine of the current rotation angle.int
hashCode()
Returns the hash code for this rotation.static double
normalizeAngle
(double fi) Returns the "normalized" equivalent of the passed angle φ: the such angle φ0, that 0<=φ0<2π and φ=φ0+2kπ for some integer k=...,-2,-1,0,1,2,...static double
normalizeAngleLessPI
(double fi) Returns the "normalized" equivalent of the passed angle φ: the such angle φ0, that 0<=φ0<π and φ=φ0+kπ for some integer k=...,-2,-1,0,1,2,....toString()
Returns some string representation of this object.
-
Method Details
-
getInstance
Returns a rotation by Δφ = 0. -
getInstance
Creates a rotation by Δφ = dfi argument (in radians). -
getRotationAngle
public double getRotationAngle()Returns the current rotation angle (in radians). -
getCosine
public double getCosine()Returns cosine of the current rotation angle. -
getSine
public double getSine()Returns sine of the current rotation angle. -
toString
Returns some string representation of this object. -
hashCode
public int hashCode()Returns the hash code for this rotation. -
equals
Indicates whether some other rotation is equal to this one, i.e. if the angle returned bygetRotationAngle()
is the same for both rotations.Note: if the difference between rotations is 2kπ, the rotations are not considered to be equal.
-
clone
Returns this instance (possible solution as this class is immutable). -
normalizeAngle
public static double normalizeAngle(double fi) Returns the "normalized" equivalent of the passed angle φ: the such angle φ0, that 0<=φ0<2π and φ=φ0+2kπ for some integer k=...,-2,-1,0,1,2,... -
normalizeAngleLessPI
public static double normalizeAngleLessPI(double fi) Returns the "normalized" equivalent of the passed angle φ: the such angle φ0, that 0<=φ0<π and φ=φ0+kπ for some integer k=...,-2,-1,0,1,2,....
-