NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
From: Frank Reed
Date: 2020 Oct 1, 15:34 -0700
There are many tools and resources with algorithms that you could dig into, and they would keep you busy for endless hours of fun. So if you're in it for that kind of "fun" (also pain) please let us know. I have professional experience calculating the Moon's position going back over forty years, and there are other people here with extensive experience in the NavList community who have attacked this problem from many different angles. But if that sort of "fun" is not what you're looking for, there's a superior approach.
Best advice I can give: you should use a table. Not a printed table, of course. A digital table. Get a table of the Moon's position for every hour of every day for the years you're interested in. Compress it using standard tools. The result covering decades of the Moon's position will be a tiny date file (we're talking about something on the order of 100 kilobytes per decade --basically nothing in the modern world). Uncompress the data you need for a given date, as needed. And then your only equation is simple linear interpolation between the tabulated values. This is absolutely the best wasy to proceed. Recalculating the Moon's position from "low-level" astronomical code is totally unnecessary. But then again... maybe for the fun (and/or pain!) of it?
Frank Reed
Clockwork Mapping / ReedNavigation.com
Conanicut Island USA