I'm an amateur astronomer, with my own guesswork after looking at 4.09 code in Sun.java...
It looks to me that setAstronomic(i, j, k, l, i1, j1) variables are:
year, month, day, hour, minute and second.
(j * 30 + k) - 80) * DEG2RAD
means month number times 30 plus day of month to get number of days since beginning of year.
The subtraction of 80 would seem to be the number of days from start of year to vernal equinox (~Mar 21). This is when the Sun is crossing the equator going north, and is a useful fiducial because the Sun's declination range of +-23.5 degrees uniformly straddles this. So in this case the 'astronomical' year effectively begins on Mar 21.
This result is then converted to radians. But this seems weird, in that there is no apparent determination of the *fraction* of the 365-day-year elapsed since the vernal equinox, which necessarily involves dividing the number of days by 365. Only when the *fractional* year is determined can conversion to an angle proceed.
The later appearance of 22.5 is a little odd, and I wonder if it's supposed to be 23.5, or the inclination of the ecliptic (Sun's path across the sky) w.r.t. the celestial equator.
The value of 29.53 is the lunar month duration in days, or the interval between successive New moons (or Full Moons).
The value of 6.283185 is the number of radians in a 360 degree circle.
Just a few pointers that hopefully can lead to some progress.
I know that the Moon position code is a bit buggered. There are times where it *clearly* lies far from the ecliptic plane, with the result that the phase is notably incongruent with the angular separation from the Sun, and the azimuth is well out of whack.
I might point out that I've written star charting code (in BASIC) to generate maps for the illustrations I've published in books and magazines. As well as having been involved with a commercial software Sky charting product. Not to mention an active involvement in amateur astronomy since 1975.