public class Angle extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Angle>, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Angle.Format
For formatting output values as strings.
|
static class |
Angle.Units
Various units used for angles, and their symbols.
|
Modifier and Type | Field and Description |
---|---|
static Angle |
FULL_CIRCLE |
static Angle |
HALF_TURN |
static Angle |
RIGHT_ANGLE |
static double |
TWO_PI |
static Angle |
ZERO |
Constructor and Description |
---|
Angle(double x,
Angle.Units units)
Construct from numerical value plus units.
|
Modifier and Type | Method and Description |
---|---|
static Angle |
acos(double x) |
Angle |
add(Angle other)
Returns new Angle which is the sum of the present one and other.
|
static Angle |
asin(double x) |
static Angle |
atan(double x) |
static Angle |
atan2(double y,
double x) |
Angle |
clone() |
int |
compareTo(Angle other)
Implements java.lang.Comparable
|
double |
cos() |
Angle |
difference(Angle other)
Similar to subtract but the result is in the range -180..180 degrees.
|
boolean |
equals(java.lang.Object obj) |
double |
getValue(Angle.Units units)
May pass null as the units in which case the value is returned in radians.
|
int |
hashCode() |
Angle |
in360()
Returns a new Angle whose value lies in range 0..360 degrees (or 0..2pi radians).
|
Angle |
multiply(double factor)
Returns a new Angle that is the result of multiplying the current one by a factor.
|
static Angle |
parseAngle(java.lang.String s)
Allow all possible formatting of the String.
|
double |
sin() |
Angle |
subtract(Angle other)
Returns a new Angle which is the result of subtracting other from this.
|
double |
tan() |
java.lang.String |
toString() |
java.lang.String |
toString(Angle.Format format,
int nFractionalDigitsForSecs)
Convert to string comprising degrees (or hours), minutes and seconds with the correct symbols,
specifying the number of fractional digits to show for the seconds.
|
java.lang.String |
toString(Angle.Units units) |
public static final double TWO_PI
public static final Angle ZERO
public static final Angle RIGHT_ANGLE
public static final Angle HALF_TURN
public static final Angle FULL_CIRCLE
public Angle(double x, Angle.Units units)
public static Angle parseAngle(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public double getValue(Angle.Units units)
public double cos()
public double sin()
public double tan()
public static Angle acos(double x)
public static Angle asin(double x)
public static Angle atan(double x)
public static Angle atan2(double y, double x)
public Angle in360()
public Angle add(Angle other)
public Angle subtract(Angle other)
public Angle multiply(double factor)
public Angle difference(Angle other)
public int compareTo(Angle other)
compareTo
in interface java.lang.Comparable<Angle>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Angle clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Angle.Units units)
public java.lang.String toString(Angle.Format format, int nFractionalDigitsForSecs)