public enum AngleUnit extends java.lang.Enum<AngleUnit>
AngleUnit
represents angles in different units of measure and
provides utility methods to convert across units. AngleUnit
does not
maintain angle information information internally, but only helps organize
and use angle measures that may be maintained separately across various contexts.
Angles can be distinguished along (at least) two axes:
Unnormalized angles can be handy when the angular quantity is not a physical angle but some related quantity such as an angular velocity or acceleration, where the quantity in question lacks the 360-degree cyclical equivalence of a physical angle.
AngleUnit
expresses normalized angles, while UnnormalizedAngleUnit
expresses unnormalized ones
Modifier and Type | Field and Description |
---|---|
byte |
bVal |
static float |
Pif |
protected static double |
TwoPi |
Modifier and Type | Method and Description |
---|---|
double |
fromDegrees(double degrees) |
float |
fromDegrees(float degrees) |
double |
fromRadians(double radians) |
float |
fromRadians(float radians) |
double |
fromUnit(AngleUnit them,
double theirs) |
float |
fromUnit(AngleUnit them,
float theirs) |
UnnormalizedAngleUnit |
getUnnormalized() |
double |
normalize(double mine) |
float |
normalize(float mine) |
static double |
normalizeDegrees(double degrees) |
static float |
normalizeDegrees(float degrees) |
static double |
normalizeRadians(double radians) |
static float |
normalizeRadians(float radians) |
double |
toDegrees(double inOurUnits) |
float |
toDegrees(float inOurUnits) |
double |
toRadians(double inOurUnits) |
float |
toRadians(float inOurUnits) |
static AngleUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AngleUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AngleUnit DEGREES
public static final AngleUnit RADIANS
public final byte bVal
protected static final double TwoPi
public static final float Pif
public static AngleUnit[] values()
for (AngleUnit c : AngleUnit.values()) System.out.println(c);
public static AngleUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic double fromDegrees(double degrees)
public float fromDegrees(float degrees)
public double fromRadians(double radians)
public float fromRadians(float radians)
public double fromUnit(AngleUnit them, double theirs)
public float fromUnit(AngleUnit them, float theirs)
public double toDegrees(double inOurUnits)
public float toDegrees(float inOurUnits)
public double toRadians(double inOurUnits)
public float toRadians(float inOurUnits)
public double normalize(double mine)
public float normalize(float mine)
public static double normalizeDegrees(double degrees)
public static float normalizeDegrees(float degrees)
public static double normalizeRadians(double radians)
public static float normalizeRadians(float radians)
public UnnormalizedAngleUnit getUnnormalized()