public static CAASelenographicMoonDetails CalculateSelenographicPositionOfSun(double JD) { double R = CAAEarth.RadiusVector(JD)*149597970; double Delta = CAAMoon.RadiusVector(JD); double lambda0 = CAASun.ApparentEclipticLongitude(JD); double lambda = CAAMoon.EclipticLongitude(JD); double beta = CAAMoon.EclipticLatitude(JD); double lambdah = CAACoordinateTransformation.MapTo0To360Range(lambda0 + 180 + Delta/R *57.296 *Math.Cos(CAACoordinateTransformation.DegreesToRadians(beta))*Math.Sin(CAACoordinateTransformation.DegreesToRadians(lambda0 - lambda))); double betah = Delta/R *beta; //What will be the return value CAASelenographicMoonDetails details = new CAASelenographicMoonDetails(); //Calculate the optical libration double omega=0; double DeltaU = 0; double sigma = 0; double I = 0; double rho = 0; double ldash0 = 0; double bdash0 = 0; double ldash20 = 0; double bdash20 = 0; double epsilon = 0; CalculateOpticalLibration(JD, lambdah, betah, ref ldash0, ref bdash0, ref ldash20, ref bdash20, ref epsilon, ref omega, ref DeltaU, ref sigma, ref I, ref rho); details.l0 = ldash0 + ldash20; details.b0 = bdash0 + bdash20; details.c0 = CAACoordinateTransformation.MapTo0To360Range(450 - details.l0); return details; }
public static CAASelenographicMoonDetails CalculateSelenographicPositionOfSun(double JD) { double R = CAAEarth.RadiusVector(JD) * 149597970; double Delta = CAAMoon.RadiusVector(JD); double lambda0 = CAASun.ApparentEclipticLongitude(JD); double lambda = CAAMoon.EclipticLongitude(JD); double beta = CAAMoon.EclipticLatitude(JD); double lambdah = CAACoordinateTransformation.MapTo0To360Range(lambda0 + 180 + Delta / R * 57.296 * Math.Cos(CAACoordinateTransformation.DegreesToRadians(beta)) * Math.Sin(CAACoordinateTransformation.DegreesToRadians(lambda0 - lambda))); double betah = Delta / R * beta; //What will be the return value CAASelenographicMoonDetails details = new CAASelenographicMoonDetails(); //Calculate the optical libration double omega = 0; double DeltaU = 0; double sigma = 0; double I = 0; double rho = 0; double ldash0 = 0; double bdash0 = 0; double ldash20 = 0; double bdash20 = 0; double epsilon = 0; CalculateOpticalLibration(JD, lambdah, betah, ref ldash0, ref bdash0, ref ldash20, ref bdash20, ref epsilon, ref omega, ref DeltaU, ref sigma, ref I, ref rho); details.l0 = ldash0 + ldash20; details.b0 = bdash0 + bdash20; details.c0 = CAACoordinateTransformation.MapTo0To360Range(450 - details.l0); return(details); }
public static double AltitudeOfSun(double JD, double Longitude, double Latitude) { //Calculate the selenographic details CAASelenographicMoonDetails selenographicDetails = CalculateSelenographicPositionOfSun(JD); //convert to radians Latitude = CAACoordinateTransformation.DegreesToRadians(Latitude); Longitude = CAACoordinateTransformation.DegreesToRadians(Longitude); selenographicDetails.b0 = CAACoordinateTransformation.DegreesToRadians(selenographicDetails.b0); selenographicDetails.c0 = CAACoordinateTransformation.DegreesToRadians(selenographicDetails.c0); return(CAACoordinateTransformation.RadiansToDegrees(Math.Asin(Math.Sin(selenographicDetails.b0) * Math.Sin(Latitude) + Math.Cos(selenographicDetails.b0) * Math.Cos(Latitude) * Math.Sin(selenographicDetails.c0 + Longitude)))); }