Saharan Courtyard Sun Path

2D companion of the library of the sands: tall walls around a small court keep most of its floor in shade, and the shade changes with the hour and the season.

Switch to 3D

Presets

Playback

Apparatus

Model checks

The science

What is modelled

The sun direction is found from the latitude, the declination of the day and the hour angle. A ray from a floor point towards the sun stays in the sun only if it is still inside the courtyard outline when it has climbed to the wall height. That makes the sunlit part of the floor exactly the overlap of the floor rectangle with a copy of itself shifted by the horizontal length of the wall shadow, so the shaded fraction needs no rendering.

Equations

  • sin e = sin φ sin δ + cos φ cos δ cos h, δ = 23.44° sin[2π(d − 81)/365].
  • Shadow shift (Δx, Δy) = H (east, north) / sin e.
  • Sunlit share (1 − |Δx|/W)(1 − |Δy|/D) (each factor not below zero).
  • Absorbed energy ∫ DNI sin e (1 − ρ) flit dt.

Checks run in the page

  • Ray tracing from random floor points against the exact overlap.
  • Noon height from the vector formula against 90 minus the latitude offset.
  • Daily energy for three time steps.
  • Very low and very high walls.

Honest simplifications

Only direct sunlight is counted, with a simple clear-sky air-mass formula; sky light, wall reflections, floor heating and the air temperature in the court are not modelled. The courtyard is a plain rectangle with walls of equal height aligned north-south and east-west.

What to try
  • Press Deep narrow court and look at the bright patch at noon.
  • Press Winter, Chinguetti and compare the mean shade with summer.
  • Raise the wall height and read the daily absorbed sunlight.
Shade through the day
Mean shade against wall height
Absorbed sunlight through the year
Sun height and azimuth
Made with 🤖 ChatGPT