The equations are from Jean Meeus' "Astronomical Algorithms." Given a time and location, it calculates relative lunar positions, rise/set times, distance, illumination, and more.
Available on Maven Central (Java 17+): https://github.com/dgrims3/MoonLocatorLibrary
Happy to answer questions!