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
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the different angular directions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AnglefromRadians(double radians) Creates an Angle from an angle value in radians.doubleReturns the value in degrees constrained between[0, 360].doubleReturns the value in radians constrained between[0, 2*PI]inthashCode()static doublenormalize(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
-
plus
-
minus
-
equals
-
hashCode
public int hashCode()
-