Package com.toxicrain.rainengine.util
Class MathUtils
java.lang.Object
com.toxicrain.rainengine.util.MathUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
approximatelyEqual
(float a, float b, float epsilon) static float
calculateAngle
(double x, double y) Calculates the angle in degrees between the positive x-axis and the point (x, y).static float
clamp
(float value, int min, int max) static float
getRandomFloatBetween
(float min, float max) static int
getRandomIntBetween
(int min, int max)
-
Constructor Details
-
MathUtils
public MathUtils()
-
-
Method Details
-
getRandomIntBetween
public static int getRandomIntBetween(int min, int max) -
getRandomFloatBetween
public static float getRandomFloatBetween(float min, float max) -
clamp
public static float clamp(float value, int min, int max) -
calculateAngle
public static float calculateAngle(double x, double y) Calculates the angle in degrees between the positive x-axis and the point (x, y).- Parameters:
x
- The x-coordinate.y
- The y-coordinate.- Returns:
- The angle in degrees.
-
approximatelyEqual
public static boolean approximatelyEqual(float a, float b, float epsilon)
-