* the largest acceptable value.
* @return returns value restricted to be within the range [low, high].
*/
- public static double restrictToRange(double value, double low, double high) {
+ public static double constrain(double value, double low, double high) {
value = Math.max(value, low);
value = Math.min(value, high);
return value;
/***
* Returns true if val is in the range [low, high]
- *
+ *
* @param val
* value to test
* @param low