Package com.actelion.research.util
Class Angle
- java.lang.Object
-
- com.actelion.research.util.Angle
-
public class Angle extends java.lang.ObjectThis class provides various operations on angles, while making sure that the values is always in the rangle from -pi >= v > pi.
-
-
Field Summary
Fields Modifier and Type Field Description doubleTWO_PI
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double value)voidadd(Angle a)static Anglearccos(double x)static Anglearcsin(double x)static Anglearctan(double y, double x)doublecos()static doubledifference(double a2, double a1)Determines the normalized difference between a2 and a1, i.e.static doubledifference(Angle a2, Angle a1)Determines the normalized difference between a2 and a1, i.e.doublegetValue()booleanisGreaterThan(Angle a)Determines whether this angle is on the greater value side of angle a, i.e.booleanisSmallerThan(Angle a)Determines whether this angle is on the smaller value side of angle a, i.e.static doublemean(Angle a1, Angle a2)Determines the mean angle between a1 and a2 on that side of the circle where a1 and a2 have the shorter connection.voidnormalize()voidsetValue(double value)doublesin()voidsubtract(double value)voidsubtract(Angle a)doubletan()doubletoDegrees()java.lang.StringtoString()
-
-
-
Field Detail
-
TWO_PI
public final double TWO_PI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Angle
public Angle()
-
Angle
public Angle(Angle a)
-
Angle
public Angle(double value)
-
-
Method Detail
-
normalize
public void normalize()
-
toDegrees
public double toDegrees()
-
getValue
public double getValue()
-
setValue
public void setValue(double value)
-
cos
public double cos()
-
sin
public double sin()
-
tan
public double tan()
-
arcsin
public static Angle arcsin(double x)
-
arccos
public static Angle arccos(double x)
-
arctan
public static Angle arctan(double y, double x)
-
mean
public static double mean(Angle a1, Angle a2)
Determines the mean angle between a1 and a2 on that side of the circle where a1 and a2 have the shorter connection.- Parameters:
a1-a2-- Returns:
-
difference
public static double difference(double a2, double a1)Determines the normalized difference between a2 and a1, i.e. the difference on that side where a1 and a2 are closer.- Parameters:
a2-a1-- Returns:
- signed value between -pi and +pi
-
difference
public static double difference(Angle a2, Angle a1)
Determines the normalized difference between a2 and a1, i.e. the difference on that side where a1 and a2 are closer.- Parameters:
a2-a1-- Returns:
- signed value between -pi and +pi
-
add
public void add(double value)
-
add
public void add(Angle a)
-
subtract
public void subtract(double value)
-
subtract
public void subtract(Angle a)
-
isSmallerThan
public boolean isSmallerThan(Angle a)
Determines whether this angle is on the smaller value side of angle a, i.e. whether it is reached faster, when walking the circle towards lower numbers.- Parameters:
a-- Returns:
-
isGreaterThan
public boolean isGreaterThan(Angle a)
Determines whether this angle is on the greater value side of angle a, i.e. whether it is reached faster, when walking the circle towards higher numbers.- Parameters:
a-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-