public class Angle extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Angle>, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
Angle.Format |
static class |
Angle.Units |
Modifier and Type | Field and Description |
---|---|
static char |
DEGREE_SYMBOL |
static double |
FOUR_PI |
static double |
TWO_PI |
protected MeasuredValue |
valueRadians |
Constructor and Description |
---|
Angle(double value,
Angle.Units units) |
Angle(double value,
double stdErr,
Angle.Units units) |
Modifier and Type | Method and Description |
---|---|
static Angle |
acos(double cos)
Inverse cosine.
|
Angle |
add(Angle other)
Returns new Angle which is the sum of the present one and other.
|
static Maths.Statistics |
angleStatistics(Angle... angles)
Calculate the min, max, mean and stdDev (all in degrees) of an array of
angles, taking into account periodicity.
|
static Maths.Statistics |
angleStatistics(java.util.Collection<Angle> angles)
Calculate the min, max, mean and stdDev (all in degrees) of a set or
list of angles, taking into account periodicity.
|
static Angle |
asin(double sin)
Inverse sine.
|
static Angle |
atan(double tan)
Inverse tangent.
|
static Angle |
atan2(double y,
double x)
Inverse tangent.
|
Angle |
clone()
Returns a new Angle with the same fields.
|
int |
compareTo(Angle other)
Implements java.lang.Comparable
|
double |
cos()
Cosine.
|
Angle |
difference(Angle other)
Similar to subtract but the result is in the range -180..180 degrees.
|
boolean |
equals(Angle other,
Angle tolerance) |
boolean |
equals(java.lang.Object obj) |
double |
getDegrees()
Get the value in degrees.
|
double |
getHours()
Get the value in hours.
|
double |
getRadians()
Get the value in radians.
|
double |
getStdErrDegrees()
Get the standard error in degrees.
|
double |
getStdErrHours()
Get the standard error in hours.
|
double |
getStdErrRadians()
Get the standard error 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()
Sine.
|
Angle |
subtract(Angle other)
Returns a new Angle which is the result of subtracting other from this.
|
double |
tan()
Tangent.
|
java.lang.String |
toString()
Units are radians.
|
java.lang.String |
toString(Angle.Units requiredUnits)
Get a String representing the angle in the required units.
|
java.lang.String |
toString(java.lang.String pattern)
Rather like java.text.SimpleDateFormat, this method allows the use of a
format string which can be as follows.
|
public static final double TWO_PI
public static final double FOUR_PI
public static final char DEGREE_SYMBOL
protected MeasuredValue valueRadians
public Angle(double value, Angle.Units units)
public Angle(double value, double stdErr, Angle.Units units)
public double getDegrees()
public double getHours()
public double getRadians()
public double getStdErrDegrees()
public double getStdErrHours()
public double getStdErrRadians()
public static Angle parseAngle(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public double cos()
public double sin()
public double tan()
public static Angle acos(double cos)
public static Angle asin(double sin)
public static Angle atan(double tan)
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 static Maths.Statistics angleStatistics(java.util.Collection<Angle> angles)
public static Maths.Statistics angleStatistics(Angle... angles)
public Angle clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Angle.Units requiredUnits)
public java.lang.String toString(java.lang.String pattern)
[x][+][d]d [m]m [s]s[.][s] - any number of trailing s's. [+][d]d.[d] - any number of trailing d's. [x][+][h]h [m]m.[m] - any number of trailing m's.
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object