Class GeometryUtil
- java.lang.Object
-
- com.github.stefvanschie.inventoryframework.util.GeometryUtil
-
public class GeometryUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description GeometryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map.Entry<Integer,Integer>
processClockwiseRotation(int x, int y, int length, int height, int rotation)
Calculates a clockwise rotation across a two dimensional gridstatic 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.
-
-
-
Method Detail
-
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
-
-