public static double clamp ( double value , double min , double max ) { final double fixed ; if ( value < min ) { fixed = min ; } else if ( value > max ) { fixed = max ; } else { fixed = value ; } return fixed ; }
Fix a value between an interval .