$ render --circuit barcelona-catalunya
Circuit de Barcelona-Catalunya
Montmeló · 4.657 km · 16 cornerslivery
main straight
1047 m
lap record
1:14.637
M. Schumacher · Ferrari · 2006
on track
car 01 · selected livery
car 02 · purple
■ simulation runningcurvature-based speed · canvas api · requestAnimationFrameS/F line at 540m
$ cat circuit-simulation/README.md
Real-Time Circuit Simulation
Path interpolation + Canvas API. A car that follows the track based on real curvature data.
Context
Started as a way to represent an F1 circuit visually — not a static image, but something with real movement and physics.
Problem
Make the car follow the track smoothly, with speed that varies based on actual corner geometry — not just a fixed rate.
Solution
A system of centerline points with distance-based interpolation. Speed is computed from local curvature: tight corners slow the car, straights speed it up.
Real-world reference
Lap time is calibrated to the actual circuit record — 1:14.637, Michael Schumacher, Ferrari, 2006.
What I learned
Canvas animation loops, geometry for trajectory systems, and real-time rendering performance in the browser.
Technologies
JavaScriptTypeScriptCanvas APIrequestAnimationFrame