private float applyBounce(float velocity,float distOutOfBounds,float simulationRate){
  if (isZero(distOutOfBounds)) {
    return velocity;
  }
  velocity*=-1;
  float bounce=BOUNCE_MULTIPLIER * Math.abs(distOutOfBounds / mIrisRadius);
  if (velocity > 0) {
    velocity+=bounce * simulationRate;
  }
 else {
    velocity-=bounce * simulationRate;
  }
  return velocity;
}

private float applyBounce ( float velocity , float distOutOfBounds , float simulationRate ) { if ( isZero ( distOutOfBounds ) ) { return velocity ; } velocity *= - 1 ; float bounce = BOUNCE_MULTIPLIER * Math . abs ( distOutOfBounds / mIrisRadius ) ; if ( velocity > 0 ) { velocity += bounce * simulationRate ; } else { velocity -= bounce * simulationRate ; } return velocity ; }
update velocity in response to bouncing off the sides of the eye ( i . e . , when iris hits the bottom or the eye moves quickly ) . this is the only way to gain horizontal velocity , since there is no other horizontal force .
