Track position on a grid with North up and East right. A right turn moves clockwise (N → E → S → W); a left turn moves anticlockwise.
1Tools
Keep a running (x, y) position: East +x, West −x, North +y, South −y
Shortest distance from start = √(x² + y²) (Pythagoras)
Final direction combines the vertical and horizontal parts, e.g. North-East
In the morning the sun is in the East, so shadows fall to the West (reverse in the evening)