Relatedly, has anyone seen tooling or approaches to calculate shadows behind particular hills and mountains, depending on the season and time of day? The sunset calculation for Boulder Colorado is quite inaccurate as we are in the foothills with mountains to the west. I've been pondering how to calculate this precisely.
Given the mountains, the sun would appear to set when it descends below some altitude angle. Given the equation in the wikipedia article you'd then just solve for the hour angle. (You'd then have to use your latitude to convert the local solar time to Mountain Standard Time.)
Perhaps a rough look-up table for (say) each 10 degrees of azimuth around the observing point that gives the altitude to solve for? Finally a couple of iterations to find what azimuth the Sun will be nearer the actual setting time, perhaps taking the 'flat horizon' setting time as a starting value?