Documentation of 'org.freehep.util.DiscreteAngle' Java class
DiscreteAngle
org.freehep.util

Class DiscreteAngle



  • public class DiscreteAngle
    extends java.lang.Object
    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

      Constructors 
      Constructor and Description
      DiscreteAngle() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.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(java.lang.String[] args) 
      boolean removeAngle(double angle)
      Removes a discrete angle from the set.
      boolean removeAngle(java.lang.Double angle)
      Removes a discrete angle from the set.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DiscreteAngle

        public DiscreteAngle()
    • Method Detail

      • getAngle

        public double getAngle(double angle)
        Returns the closest angle to any discrete angle in the set. Returns itself if the set is empty. Returns the only discrete angle if the set only contains one angle.
      • addAngle

        public java.lang.Double addAngle(double angle)
        Adds a discrete angle to the set.
      • removeAngle

        public boolean removeAngle(double angle)
        Removes a discrete angle from the set.
      • removeAngle

        public boolean removeAngle(java.lang.Double angle)
        Removes a discrete angle from the set.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • main

        public static void main(java.lang.String[] args)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.