code: public static Coordinate getPosition(Date date, double lat,
              double lng) {
          if (isGeographic(lat, lng)) {
              double lw = rad * -lng;
              double phi = rad * lat;
              double J = dateToJulianDate(date);
              double M = getSolarMeanAnomaly(J);
              double C = getEquationOfCenter(M);
              double Ls = getEclipticLongitude(M, C);
              double d = getSunDeclination(Ls);
              double a = getRightAscension(Ls);
              double th = getSiderealTime(J, lw);
              double H = th - a;
              return new Coordinate(getAzimuth(H, phi, d),getAltitude(H, phi, d));
          } else {
              throw new IllegalArgumentException("The coordinate of the point must in latitude and longitude.");
          }
      }
docs: Returns the sun position as a coordinate with the following properties
  
  x: sun azimuth in radians (direction along the horizon, measured from south to
  west), e.g. 0 is south and Math.PI * 3/4 is northwest.
  y: sun altitude above the horizon in radians, e.g. 0 at the
  horizon and PI/2 at the zenith (straight over your head).
  
  
  @param date
  @param lat
  @param lng
  @return