Class GeometryUtil
java.lang.Object
com.github.stefvanschie.inventoryframework.util.GeometryUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprocessClockwiseRotation
(int x, int y, int length, int height, int rotation) Calculates a clockwise rotation across a two dimensional gridprocessCounterClockwiseRotation
(int x, int y, int length, int height, int rotation) Calculates a counter clockwise rotation across a two dimensional grid.
-
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 coordinatey
- the standard y coordinatelength
- the length of the gridheight
- the height of the gridrotation
- 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 callingprocessClockwiseRotation(int, int, int, int, int)
with 360 - rotation as the rotation.- Parameters:
x
- the standard x coordinatey
- the standard y coordinatelength
- the length of the gridheight
- the height of the gridrotation
- the rotation in degrees- Returns:
- a pair of new coordinates, with the x coordinate being the key and the y coordinate being the value
-