Class Angle
java.lang.Object
org.eclipse.gef.geometry.euclidean.Angle
- All Implemented Interfaces:
- Serializable,- Cloneable
 An Angle object abstracts the angle's unit. It provides a simple
 interface to construct it from degrees or radians. Additionally, some useful
 calculations are implemented. But for sine/cosine/tangent calculations you
 may use the Math package.
 
 Every Angle object is normalized. That means, you will never
 encounter an Angle object beyond 360/2pi or below 0/0
 (degrees/radians).
 
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()Overridden with public visibility as proposed inCloneable.doubledeg()Returns the value of thisAngleobject in degrees.booleanstatic AnglefromDeg(double degrees) Constructs a newAngleobject representing the given value.static AnglefromRad(double radians) Constructs a newAngleobject representing the given value.getCopy()Creates and returns a copy of thisAngle.getDeltaCCW(Angle other) getDeltaCW(Angle other) getMultiplied(double factor) inthashCode()booleanisClockwise(Angle other) doublerad()Returns thisAngle's value in radians.setDeg(double degrees) Sets thisAngle's value to the passed-in value in degrees.setRad(double radians) Sets thisAngle's value to the passed-in value in radians.toString()
- 
Constructor Details
- 
Method Details- 
fromDegConstructs a newAngleobject representing the given value. The value is interpreted as being in degrees.- Parameters:
- degrees- the angle in degrees
- Returns:
- an Angleobject representing the passed-in angle given in degrees
 
- 
fromRadConstructs a newAngleobject representing the given value. The value is interpreted as being in radians.- Parameters:
- radians- the angle in radians
- Returns:
- an Angleobject representing the passed-in angle given in radians
 
- 
cloneOverridden with public visibility as proposed inCloneable.
- 
degpublic double deg()Returns the value of thisAngleobject in degrees.- Returns:
- this Angle's value in degrees.
 
- 
equals
- 
getAdded
- 
getCopyCreates and returns a copy of thisAngle.- Returns:
- a copy of this Angle
 
- 
getDeltaCCW
- 
getDeltaCW
- 
getMultiplied
- 
getOppositeFull
- 
getOppositeSemi
- 
getReverse
- 
hashCodepublic int hashCode()
- 
isClockwise- Parameters:
- other- the other angle to compare to
- Returns:
- true if the a clockwise rotation to the other angle is less than 180deg
 
- 
radpublic double rad()Returns thisAngle's value in radians.- Returns:
- This Angle's value in radians.
 
- 
setDegSets thisAngle's value to the passed-in value in degrees.- Parameters:
- degrees- the angle's value in degrees
- Returns:
- thisfor convenience
 
- 
setRadSets thisAngle's value to the passed-in value in radians.- Parameters:
- radians- the angle's value in radians
- Returns:
- thisfor convenience
 
- 
toString
 
-