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." ) ; } }
Returns the sun position as a coordinate with the following properties