Java Utililty Methods Double Number Clamp

List of utility methods to do Double Number Clamp

Description

The list of methods to do Double Number Clamp are organized into topic(s).

Method

doubleclamp_double(double num, double min, double max)
clamdouble
return num < min ? min : (num > max ? max : num);
doubleclamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_)
clamdouble
return p_151237_0_ < p_151237_2_ ? p_151237_2_ : (p_151237_0_ > p_151237_4_ ? p_151237_4_ : p_151237_0_);
doubleclamp_doubleback(double a, double x, double y)
Returns the given double clamped between the two values.
double newA = Math.abs(Math.IEEEremainder(a, 2 * (y - x)));
if (newA > y)
    newA = 2 * y - newA;
return newA;
doubleclamp_latitude(double lat)
Ensure value is in the valid range for latitude ([-pi, pi])
if (lat > StrictMath.PI) {
    return StrictMath.PI;
} else if (lat < -StrictMath.PI) {
    return -StrictMath.PI;
} else {
    return lat;
doubleclampAngle(double angle)
Clamps the angle in the interval [0, 360), performing 360*N shift if needed.
if (angle >= 0)
    return angle % 360;
return 360 * ceiling(-angle / 360) + angle;
doubleclampedLerp(double lowerBnd, double upperBnd, double slide)
clamped Lerp
return slide < 0.0D ? lowerBnd : (slide > 1.0D ? upperBnd : lowerBnd + (upperBnd - lowerBnd) * slide);
floatclampFloat(double in)
Clamps a number to the range supported by float data type.
return (in > Float.MAX_VALUE ? Float.MAX_VALUE : (in >= FLOAT_MIN ? (float) in : FLOAT_MIN));
doubleclampMax(double val, double max)
clamp Max
return val < max ? val : max;
doubleclampMax(final double MAX, final double VALUE)
clamp Max
if (VALUE > MAX)
    return MAX;
return VALUE;
doubleclampMin(double input, double min)
Ensures that a number is bigger than a given value.
if (input < min)
    return min;
else
    return input;