I recently built a Solar Alignment Calculator, with the (considerable) help of Claude. Could “we” pull off a similar trick, a Lunar Alignment Calculator, for predicting the alignment of moonsets with terrestrial landmarks? And, would it take into account all those phases the moon passes through each month?
This one could be complicated!
Flushed with the success of my first vibe-coding experience — a personalized app for calculating when the sun would set behind a local point of interest — my thoughts turned to an obvious extension: an analogous app for determining when the moon would set at a specific point on the horizon.
Killer shots
My motivation for producing these apps was so that I could plan ahead for some killer photographs. If I got the timing right, viewed through a telephoto lens these celestial objects would appear as gigantic, luminous orbs, hovering next to a distant point of interest.
Assuming there were no clouds in the way, that is…

Since Claude was already familiar with my thinking on the Solar Alignment Calculator, I composed what I thought was a full description of the app I envisaged. It turned out that it was not as complete as I’d thought.
Keith’s prompt
Now that you have built this beautiful solar alignment photography planner, I would like you to build a new, similar tool to find precise dates when the moon rises or sets along my chosen bearing. Please keep the same input fields for point A (where the camera is sited) and point B (the target point on the horizon) as well as year, time zone, and degree of accuracy. For the output, please indicate the date and time that the moon will be at the target point. Also indicate whether the moon is rising or setting.
Claude’s response
Read the frontend design skill
Now let me plan the lunar math carefully before coding. The moon's position requires a more complex algorithm than the sun — I'll use the Jean Meeus (Astronomical Algorithms) approach to compute the moon's azimuth at moonrise and moonset for each day of the year, stepping through the day in fine increments to find the exact crossing moments.
Created a file, read a file
Here's your Lunar Alignment Photography Planner — a companion to the solar tool, with the same inputs and workflow but built around the moon's more complex motion.



Claude’s overview
What’s the same?
what3words address resolution, manual coordinate entry, GPS location, year/timezone/tolerance settings, the bearing line map, and the filtered results table with month tabs.
What’s new and different:
The lunar algorithm is substantially more complex than the solar one. Rather than a simple formula, it uses Jean Meeus's full lunar theory (from Astronomical Algorithms) with 60 longitude terms, 30 latitude terms, and atmospheric refraction correction — giving accuracy to within about 0.1°, which is well within photography tolerances.
The results table has two additional columns compared to the solar planner:
- Event — clearly labelled ↑ Moonrise or ↓ Moonset, so you know which horizon to point your camera at
- Moon Phase — shows the phase icon (🌑🌒🌓🌔🌕🌖🌗🌘) and name (e.g. Waxing Gibbous, Full Moon) at the moment of alignment, which is crucial for a photography shoot — a full moon aligning with your target is very different from a new moon doing the same
A note on computation: the moon's azimuth is calculated by stepping through every day in 2-minute increments and detecting horizon crossings, so the calculation takes a few seconds for a full year — you'll see a "computing" indicator while it works.
Observations
- Building on the previous dialog accelerated the creation of this related app
- Claude therefore generated a fully-functional app in a single step
- I did not include moon phases in my prompt, but Claude knew these were highly relevant!
- Claude used both emoji and word-based descriptions of these phases
- The output of the app conveys more information than the Solar Alignment Calculator, but is still very clear
- The app does not take into account the change to Daylight Saving Time
What I learned
- Keep a copy of the original prompt and subsequent dialog
- Incorporate all the attributes of your envisaged app in the prompt
- You can plan a shot down to the minute, but still be thwarted by clouds
Pursuit of the killer shot continues
To date, although I am confident that the app correctly predicts the time and date of alignment events, my attempts to photograph a moonset aligned with either of the Point Loma Lighthouses has been thwarted by early morning clouds. Perhaps I will have more success later in the year.
This is the kind of shot I am after; in this case it’s a merge of two separate photos.



Leave a Reply