private void calculatePanningSpeed(){
  final int dux=dvx / PAN_INERTIA;
  final int duy=dvy / PAN_INERTIA;
  final int tspeed=((dux * dux) + (duy * duy)) * PAN_SCALE;
  if (speed > tspeed) {
    speed=(2 * speed + tspeed) / 3;
    if ((dvx != 0) || (dvy != 0)) {
      speed=Math.max(speed,1);
    }
  }
 else   if (speed < tspeed) {
    speed+=2;
  }
}

private void calculatePanningSpeed ( ) { final int dux = dvx / PAN_INERTIA ; final int duy = dvy / PAN_INERTIA ; final int tspeed = ( ( dux * dux ) + ( duy * duy ) ) * PAN_SCALE ; if ( speed > tspeed ) { speed = ( 2 * speed + tspeed ) / 3 ; if ( ( dvx != 0 ) || ( dvy != 0 ) ) { speed = Math . max ( speed , 1 ) ; } } else if ( speed < tspeed ) { speed += 2 ; } }
calculate the target speed for moving the view position . the farther away , the faster .
