public final class MathUtil extends Object
Modifier and Type | Method and Description |
---|---|
static double |
clamp(double value,
double min,
double max) |
static float |
clamp(float value,
float min,
float max) |
static int |
clamp(int value,
int min,
int max) |
static long |
clamp(long value,
long min,
long max) |
static double |
normalizeAngle(double angle)
Normalizes a radian angle between PI and -PI.
|
public static int clamp(int value, int min, int max)
value
- min
- max
- value
clamped between min
and max
.public static long clamp(long value, long min, long max)
value
- min
- max
- value
clamped between min
and max
.public static float clamp(float value, float min, float max)
value
- min
- max
- value
clamped between min
and max
.public static double clamp(double value, double min, double max)
value
- min
- max
- value
clamped between min
and max
.public static double normalizeAngle(double angle)
angle
- in radians