java.lang.Object
com.github.stefvanschie.inventoryframework.util.GeometryUtil

public class GeometryUtil extends Object
  • Constructor Details

    • GeometryUtil

      public GeometryUtil()
  • Method Details

    • processClockwiseRotation

      @NotNull @Contract(pure=true) public static Map.Entry<Integer,Integer> processClockwiseRotation(int x, int y, int length, int height, int rotation)
      Calculates a clockwise rotation across a two dimensional grid
      Parameters:
      x - the standard x coordinate
      y - the standard y coordinate
      length - the length of the grid
      height - the height of the grid
      rotation - the rotation in degrees
      Returns:
      a pair of new coordinates, with the x coordinate being the key and the y coordinate being the value
    • processCounterClockwiseRotation

      @NotNull @Contract(pure=true) public static Map.Entry<Integer,Integer> processCounterClockwiseRotation(int x, int y, int length, int height, int rotation)
      Calculates a counter clockwise rotation across a two dimensional grid. This is the same as calling processClockwiseRotation(int, int, int, int, int) with 360 - rotation as the rotation.
      Parameters:
      x - the standard x coordinate
      y - the standard y coordinate
      length - the length of the grid
      height - the height of the grid
      rotation - the rotation in degrees
      Returns:
      a pair of new coordinates, with the x coordinate being the key and the y coordinate being the value