Class PositionHelper


  • public class PositionHelper
    extends Object
    • Constructor Detail

      • PositionHelper

        public PositionHelper()
    • Method Detail

      • inCicle

        public static boolean inCicle​(int x,
                                      int y,
                                      int centerX,
                                      int centerY,
                                      int r)
        calcul if a point is in a circle.
        Parameters:
        x - coord. x of the point
        y - coord. y of the point
        centerX - center x of the circle
        centerY - center y of the circle
        r - radius of the circle
        Returns:
        true if point is in the circle.
      • zone

        public static int zone​(int x,
                               int y,
                               int centerX,
                               int centerY)
        determine the zone of a point. 1 2 c 3 4
        Parameters:
        x - position x of the point.
        y - position y of the point.
        centerX - position x of the center.
        centerY - position y of the center.
        Returns:
        the zone of the point.
      • isOutRoundBorder

        public static boolean isOutRoundBorder​(int x,
                                               int y,
                                               int width,
                                               int height,
                                               int radius)