|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.util.DiscreteAngle
Calculates a discrete angle from an arbitrary angle, based on a set of given angles. The class calculates the angle by dividing 360 degrees into segments based on the discrete angles. It then will calculate the closest discrete angle for a given angle. Discrete angles can be added and removed. This class can be used to constrain the mouse movement (or its result) if one wants to draw under certain angles only.
Constructor Summary | |
DiscreteAngle()
|
Method Summary | |
Double |
addAngle(double angle)
Adds a discrete angle to the set. |
double |
getAngle(double angle)
Returns the closest angle to any discrete angle in the set. |
static void |
main(String[] args)
|
boolean |
removeAngle(double angle)
Removes a discrete angle from the set. |
boolean |
removeAngle(Double angle)
Removes a discrete angle from the set. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DiscreteAngle()
Method Detail |
public double getAngle(double angle)
public Double addAngle(double angle)
public boolean removeAngle(double angle)
public boolean removeAngle(Double angle)
public String toString()
public static void main(String[] args)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |