3 min read

Developing a tool for identifying structure shade coverage based on azimuth, altitude, time of year, and time of day

I wanted to build a grill shelter beside my back patio to block the western sun in the evenings when we’re often outside as a family (anytime it’s over ~45F), but I needed to know the proper height/positioning of the shelter that would work at different times of day and year. The azimuth and altitude of the sun obviously vary a great deal throughout the year in the Upper Midwest (among other places!), so I wanted to at least be sure the patio table would be covered when we’re usually eating dinner and goofing off in the back yard (5:00 - 8:00 PM).

At the time I was planning this, I happened to be teaching terrain analysis in GIS 2, so these functions (azimuth and altitude) were at the forefront of my mind and thought this was a good practical example to demonstrate concepts to students. I was surprised to find out that there wasn’t a simple online tool for this already, so I decided to solve it with a bit of old fashioned trigonometry. This wasn’t too difficult with an R package like suncalc (for extracting azimuth and altitude at different times of the day and year).

I figured out that if I made the gazebo about 9 ft. tall (which matches the height of the roof) with a 2 ft. difference between the front and back (plus a 2x12 in. stringer) it would create plenty of shade for our 3 ft. x 8 ft. patio table.

But I wanted to double check my results and create a generalizable solution for the hundreds of structures I might build at various locations across the globe, so I built…

“Shade Tool”

A frontier web application for identifying shade coverage for various types of objects (houses, fences, gazebos, trees) at various heights based on location (latitude primarily, although longitude does actually matter too due to east/west position within a time zone [pesky creations, time zones]) for various days and times, and also for facilitating B2B2B sales of LinkedIn games’ real-time player data.

It turns out that the science works! The shelter (not a bad construction job, I do have to say) does indeed cover the patio table in the evenings (a much more hideous piece of craftsmanship).

It’ll shade the patio quite well May to August, but by October we may be in the sun a bit, perhaps in the early evening. This isn’t as big of a deal though because aside from being obviously cooler during this time of year, since the sun also has a lower altitude in these months as well, surrounding buildings and trees will block it quite well (I know this from observation even though it’s not reflected in the tool). This is an inherent limitation of the tool, that it doesn’t consider surrounding buildings and trees, but implementation would not be infeasible with a little public LiDAR data (and I will gladly add this feature for the right price). I’ve also planted five skybound arborvitaes behind the shelter that will ideally provide a little extra shade too (they reach about 18-20 ft.).

Yes, this tool was constructed primarily with Claude Code of course, but I think it’s a great example of how you can combine an idea for solving a simple, practical problem with some geographic knowledge to create a useful tool. I never would have done this without agentic coding.

Give it a try here: https://shade-tool.netlify.app/!