static public final float atan2(float y,float x){
  float add, mul;
  if (x < 0) {
    if (y < 0) {
      y=-y;
      mul=1;
    }
 else {
      mul=-1;
    }
    x=-x;
    add=-PI;
  }
 else {
    if (y < 0) {
      y=-y;
      mul=-1;
    }
 else {
      mul=1;
    }
    add=0;
  }
  float invDiv=1 / ((x < y ? y : x) * INV_ATAN2_DIM_MINUS_1);
  if (invDiv == Float.POSITIVE_INFINITY) {
    return ((float)Math.atan2(y,x) + add) * mul;
  }
  int xi=(int)(x * invDiv);
  int yi=(int)(y * invDiv);
  return (Atan2.table[yi * ATAN2_DIM + xi] + add) * mul;
}

static public final float atan2 ( float y , float x ) { float add , mul ; if ( x < 0 ) { if ( y < 0 ) { y = - y ; mul = 1 ; } else { mul = - 1 ; } x = - x ; add = - PI ; } else { if ( y < 0 ) { y = - y ; mul = - 1 ; } else { mul = 1 ; } add = 0 ; } float invDiv = 1 / ( ( x < y ? y : x ) * INV_ATAN2_DIM_MINUS_1 ) ; if ( invDiv == Float . POSITIVE_INFINITY ) { return ( ( float ) Math . atan2 ( y , x ) + add ) * mul ; } int xi = ( int ) ( x * invDiv ) ; int yi = ( int ) ( y * invDiv ) ; return ( Atan2 . table [ yi * ATAN2_DIM + xi ] + add ) * mul ; }
returns atan2 in radians from a lookup table .
