I'm trying to make a game with high accuracy moon position so I followed some equations on geoastro.de Basics of Positional Astronomy and Ephemerides and with some help from the questions answers, I get the same result which they explained in the example.
but there is problem that is I calculate declination and right ascension by Pre-calculated values of ecliptic latitude and longitude and they didn't explain their equations or any thing about them.
I tried to search and ask, but I did not find anything, or I found very complex equations, and I don't think I will need this complexity.
So is there equation or resource that can help me to calculate declination and right ascension with limited information (Julian day and (T) number of Julian centuries since 2000/01/01 at 12 UT) or to calculate ecliptic latitude and longitude without very complex equations?
Equations of the moon altitude and azimuth:
1- Julian day = (365.25 * year) + (30.6001 * (month + 1)) - 15 + 1720996.5 + day + hour/24.0
2- T (number of Julian centuries since 2000/01/01 at 12 UT) = (JD - 2451545.0) / 36525.0
3- eps (obliquity of the ecliptic) = 23.0 + 26.0 / 60.0 + 21.448 / 3600.0 - (46.8150 * T + 0.00059 * T * T - 0.001813 * T * T * T) / 3600
Ecliptic latitude (B) = -1.87° (pre-calculated value)
Ecliptic longitude (L) = 131.52° (pre-calculated value)
4- delta (declination) = (180/PI) * arcsin[sin(eps) * cos(Ecliptic latitude) * sin(Ecliptic longitude) + cos(eps) * sin(Ecliptic latitude)]
5- RA (right ascension) = (180/PI) * arctan[(sin(Ecliptic longitude) * cos(eps) - tan(Ecliptic latitude) * sin(eps)) / cos(Ecliptic longitude)]
if arctan result is lower than zero add (PI) to arctan.
6- theta0 (sidereal time (degrees) at Greenwich) = 280.46061837 + 360.98564736629 * (JD - 2451545.0) + 0.000387933 * T * T - T * T * T / 38710000.0
7- theta (local sidereal time at longitude 10° E) = theta0 + longitude (eastern longitudes positive, western negative).
8- tau (local hour angle) = theta - RA
9- altitude = (180/PI) * arcsin[sin(latitude) * sin(delta) + cos(latitude) * cos(delta) * cos(tau)]
10- azimuth = (180/PI) * arctan2[- sin(tau) / (cos(latitude) * tan(delta) - sin(latitude) * cos(tau))]
Thanks for reading.