private float vectorToScalarScroll(float dx,float dy,float x,float y){
  float l=(float)Math.sqrt(dx * dx + dy * dy);
  float crossX=-y;
  float crossY=x;
  float dot=(crossX * dx + crossY * dy);
  float sign=Math.signum(dot);
  return l * sign;
}

private float vectorToScalarScroll ( float dx , float dy , float x , float y ) { float l = ( float ) Math . sqrt ( dx * dx + dy * dy ) ; float crossX = - y ; float crossY = x ; float dot = ( crossX * dx + crossY * dy ) ; float sign = Math . signum ( dot ) ; return l * sign ; }
helper method for translating ( x , y ) scroll vectors into scalar rotation of the pie .
