Home▸Physics & Mechanics▸City Traffic Intersection — Car-Following & Signal Timing (2D)

City Traffic Intersection — Car-Following & Signal Timing (2D)

Top-down 2D city-traffic intersection: a real car-following (IDM) model keeps every vehicle at a safe gap from the one ahead and from a red light, so queues actually form and dissipate. Tune vehicle density and signal-cycle timing and watch stop-and-go jams build.

Physics & Mechanics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-city-traffic ↗ Open standalone

This 2D companion views the same signalled four-way intersection as its 3D counterpart from directly overhead, but drives every vehicle with a real car-following model (the Intelligent Driver Model) instead of a binary stop/go rule. Each car, bus and truck continuously reacts to the gap and closing speed of whatever is directly ahead of it — another vehicle, or a red light treated as a stationary obstacle at the stop line — so braking chains realistically backward through a queue and stop-and-go waves emerge the way they do on a real road. Tune vehicle density and the traffic-light cycle to see how quickly congestion builds at the intersection and how long it takes to clear once the queue starts moving again.

⚙ Under the hood

Top-down 2D traffic intersection driven by a real car-following (IDM) model, so queues build and dissipate realistically as you tune vehicle density and signal-cycle timing.

traffic flowcar-following modelintelligent driver modeltraffic lightscongestionurban planning

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)