Class Point


  • public class Point
    extends java.lang.Object
    Point with X and Y coordinates, defined with float precision.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static float EPSILON  
    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(float x, float y)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(float deltaX, float deltaY)  
      float calculateAngle​(Point other)
      Returns the angle in degrees from this point towards the specified other point.
      float calculateDistance​(Point other)
      Returns the distance between this point and the specified other point.
      Point copy()  
      boolean equals​(java.lang.Object o)  
      float getX()  
      float getY()  
      int hashCode()  
      void move​(float deltaX, float deltaY)  
      void set​(float x, float y)  
      void set​(Point p)  
      void setX​(float x)  
      void setY​(float y)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Point

        public Point​(float x,
                     float y)
    • Method Detail

      • setX

        public void setX​(float x)
      • getX

        public float getX()
      • setY

        public void setY​(float y)
      • getY

        public float getY()
      • set

        public void set​(float x,
                        float y)
      • set

        public void set​(Point p)
      • move

        public void move​(float deltaX,
                         float deltaY)
      • add

        public void add​(float deltaX,
                        float deltaY)
      • calculateDistance

        public float calculateDistance​(Point other)
        Returns the distance between this point and the specified other point.
      • calculateAngle

        public float calculateAngle​(Point other)
        Returns the angle in degrees from this point towards the specified other point. If the points are identical this will return an angle of 0.
      • copy

        public Point copy()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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