code: public static float Angle(float x, float y) {
          if (y >= 0) {
              if (x >= 0)
                  return (float) Math.atan(y / x);
              return (float) (Math.PI - Math.atan(-y / x));
          } else {
              if (x >= 0)
                  return (float) (2 * Math.PI - Math.atan(-y / x));
              return (float) (Math.PI + Math.atan(y / x));
          }
      }
docs: Gets the angle formed by the vector [x,y].
  
  @param x X axis coordinate.
  @param y Y axis coordinate.
  @return Angle formed by the vector.