Package com.luciad.cartesian
Class Angle
java.lang.Object
com.luciad.cartesian.Angle
An angle on a mathematical circle: degrees, counter-clockwise from right/X-axis.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the different angular directions. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static Angle
fromRadians
(double radians) Creates an Angle from an angle value in radians.double
Returns the value in degrees constrained between[0, 360]
.double
Returns the value in radians constrained between[0, 2*PI]
int
hashCode()
static double
normalize
(double degrees) Normalizes the degree value to the range]-180, +180]
.
-
Constructor Details
-
Angle
Creates an angle based on the given angular value in degrees.- Parameters:
degrees
- an angle in degree- Throws:
IllegalArgumentException
- when degrees is NaN or infinite.
-
Angle
Creates an angle based on another angle.- Parameters:
angle
- an angle.
-
-
Method Details
-
normalize
public static double normalize(double degrees) Normalizes the degree value to the range]-180, +180]
.- Parameters:
degrees
- a value in degrees- Returns:
- a degrees value, normalized to
]-180, +180]
.
-
fromRadians
Creates an Angle from an angle value in radians.- Parameters:
radians
- an angle in radians- Returns:
- a new angle based on the given angle in radians
- Throws:
IllegalArgumentException
- when radians is NaN or infinite.
-
getDegrees
public double getDegrees()Returns the value in degrees constrained between[0, 360]
.- Returns:
- the value in degrees constrained between
[0, 360]
.
-
getRadians
public double getRadians()Returns the value in radians constrained between[0, 2*PI]
- Returns:
- the value in radians constrained between
[0, 2*PI]
.
-
toAzimuth
-
equals
-
hashCode
public int hashCode()
-