How to calculate the area of the shadow cast in a courtyard?

357 Views Asked by At

Consider a square courtyard (say, 20m on a side) with a north, south, east, and west wall, each 10m tall. Given the azimuth (from north) and elevation of the sun, what is the area of the shadow cast on the ground?

It's trivial when the sun is coming directly from one of the cardinal directions ($A = 20^2 - \frac{20\cdot10}{\tan(\theta)}$ where theta is the sun elevation angle), but I'm struggling with azimuths that aren't a multiple of 90 degrees and more than one wall is casting a shadow.