public final class Angle extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Angle.Direction
Represents the different angular directions.
|
Constructor and Description |
---|
Angle(Angle angle)
Creates an angle based on another angle.
|
Angle(double degrees)
Creates an angle based on the given angular value in degrees.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static Angle |
fromRadians(double radians)
Creates an Angle from an angle value in radians.
|
double |
getDegrees()
Returns the value in degrees constrained between
[0, 360] . |
double |
getRadians()
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] . |
Azimuth |
toAzimuth() |
public Angle(double degrees) throws IllegalArgumentException
degrees
- an angle in degreeIllegalArgumentException
- when degrees is NaN or infinite.public Angle(@NotNull Angle angle)
angle
- an angle.public static double normalize(double degrees)
]-180, +180]
.degrees
- a value in degrees]-180, +180]
.@NotNull public static Angle fromRadians(double radians) throws IllegalArgumentException
radians
- an angle in radiansIllegalArgumentException
- when radians is NaN or infinite.public double getDegrees()
[0, 360]
.[0, 360]
.public double getRadians()
[0, 2*PI]
[0, 2*PI]
.@NotNull public Azimuth toAzimuth()