phaseAngle2 function
Phase angle from heliocentric ecliptic coordinates.
lon, lat planet heliocentric ecliptic (radians), r planet-Sun distance,
lon0 Earth heliocentric longitude, r0 Earth-Sun, delta planet-Earth.
Implementation
double phaseAngle2(double lon, double lat, double r,
double lon0, double r0, double delta) {
return math.acos((r - r0 * math.cos(lat) * math.cos(lon - lon0)) / delta);
}