Hengefinder is an app that, given times and places, can help you experience "stunning moments when the sun or moon aligns perfectly with city streets and buildings."
A "henge" is when the sun or moon is perfectly framed by a street or appears to sit on top of a building … Astronomical calculations combined with road data deliver instant results. Works worldwide. Sunrise, sunset, moonrise, and moonset—all at your fingertips.
It's available for iPhone and on the Google Play Store, but is based on open-source software posted to Github by Victoria Ritvo. It's on the web at hengefinder.rcdis.co; my street gets henged in September, weather permitting!
Ritvo explains the surprisingly complicated maths. Planet Earth is, after all, an enormous spinning ball, orbiting the source of light in question.
It was appealing to me that this was mostly made up of many sub problems I could either think through thoroughly, or choose to mostly skip (by handing off to a library, a brute-force solution, an approximation, etc.). It's like a bunch of closed boxes. I left plenty of those boxes closed — I didn't build my own astronomical model, for instance. Other boxes I opened. And then I found many things I thought would be straightforward that turned out to be somewhat less trivial in practice as my assumptions broke; Like, in reality, you can't treat roads like flat lines, latitude and longitude don't behave like a Cartesian grid, and the word "sunset" is more ambiguous than I initially thought. I've enjoyed closing the gap between my assumptions and reality.
Note that this is an emergent definition of "henge," which was originally backformed from Stonehenge and in archeological use refers to circular earthworks with internal ditches—a specification which famously resulted in Stonehenge not even qualifying as a henge.
Previously:
• Last night was Manhattanhenge: It. Was. Glorious.
• 'Astonishing' giant circle of pits found at Stonehenge
• Ponyhenge is an enchanting rocking horse graveyard in New England
• Bunnyhenge is an oddity of Newport Beach, California