Lines Matching refs:min
120 * @return the clamped {@param value} between the provided {@param min} and {@param max}.
122 public static float clamp(float value, float min, float max) {
123 return Math.max(min, Math.min(max, value));
127 * @return the clamped {@param value} between the provided {@param min} and {@param max}.
129 public static int clamp(int value, int min, int max) {
130 return Math.max(min, Math.min(max, value));
137 return Math.max(0f, Math.min(1f, value));
141 * Scales the {@param value} to be proportionally between the {@param min} and
146 public static float mapRange(@FloatRange(from=0.0,to=1.0) float value, float min, float max) {
147 return min + (value * (max - min));
151 * Scales the {@param value} proportionally from {@param min} and {@param max} to 0 and 1.
153 * @param value must be between {@param min} and {@param max}
155 public static float unmapRange(float value, float min, float max) {
156 return (value - min) / (max - min);