private static float saturate(float f){
  return Math.max(0,Math.min(1,f));
}

private static float saturate ( float f ) { return Math . max ( 0 , Math . min ( 1 , f ) ) ; }
saturate a float value , clamping values below 0 to 0 and above 1 to 1
