Pick a place to see where the body stood in its sky at the time above. Copy the values into the form to test the fix, or to see how far an error moves the answer.
At any instant the Sun or Moon is straight overhead at one point on Earth, its geographic position. An observer who sees it at altitude h stands somewhere on a circle of radius 90° − h around that point; the azimuth says where on the circle. Navigators call this a celestial fix.
The program solves it directly. With the body's declination δ, the altitude h and the azimuth A, the observer's latitude φ satisfies sin δ = sin φ sin h + cos φ cos h cos A. Written as R sin(φ + α) = sin δ this has two roots; each is kept only if it is a real latitude and gives back the measured azimuth and altitude. The hour angle then follows from sin H = −sin A cos h / cos δ and cos H = (sin h − sin φ sin δ) / (cos φ cos δ), and the longitude is the geographic position's longitude plus H.
The Moon is close enough that its position in your sky depends on where you stand by up to about a degree (parallax). For it, and for the Sun's tiny 9″ parallax, the program repeats the solution: it computes what an observer at the first answer would see using the astronomy-engine library, corrects the inputs by the difference and solves again until the answer stops moving.
Refraction lifts objects near the horizon by about half a degree and by 1′ at 45°. If you tick the box, the standard correction for 10 °C and 1010 hPa is removed. The error region is found by solving for every point on the edge of the box azimuth ± error, altitude ± error. In practice a 1° error moves the answer by roughly 100 km, and azimuth errors grow when the body is low. Azimuths must be from true north, not magnetic north, and times must be exact: a 4-second clock error moves the longitude by about 1′ (up to 1.9 km).