DEV Community

Formula Neon
Formula Neon

Posted on Originally published at formuladream.app

Who owned each corner? Mapping F1 lap dominance in minisectors

A qualifying laptime is a single number, and a single number hides almost everything interesting about the lap.

Two drivers can set nearly identical times in completely different ways: one is quickest through the fast corners, another claws it back under braking, a third is untouchable on the run to the line. The final gap is just the sum of all of that. So the question we wanted to answer was not who was fastest, it was where each driver was fastest.

This is a short write-up of how we turn a set of laps into a track coloured by who owned each part of it, where the model is honest, and where you have to be careful.

The core idea: split the lap, compare segment by segment

A lap is a sequence of samples, each with a position on the track and a timestamp. On its own that is just a squiggle. The move that makes it readable is chopping the lap into minisectors: short segments, a few hundred metres each, defined by distance along the track rather than by time.

Distance matters here. If you split by time, every driver's segments land in different places and you cannot compare them. Split by distance and segment n is the same piece of tarmac for everyone, so "who was fastest through segment n" is a fair question.

For each segment you compute the time each driver spent crossing it, then colour the racing line by the winner:

for each driver:
  resample their lap to a common distance axis (0..trackLength)
  for each minisector [d0, d1]:
    t_in  = interpolate time at distance d0
    t_out = interpolate time at distance d1
    segmentTime[driver][sector] = t_out - t_in

for each minisector:
  winner = argmin over drivers of segmentTime[driver][sector]
  colour that stretch of the racing line with winner's team colour
Enter fullscreen mode Exit fullscreen mode

The resample-to-a-common-distance-axis step is the whole trick. Raw telemetry is sampled in time, not distance, so before you can compare "the same corner" across drivers you interpolate every lap onto a shared distance grid. After that, the comparison is just an argmin per segment.

The lap nobody drove

Once you have per-driver segment times, one more line gives you something people love: the theoretical best lap.

theoreticalBest = sum over sectors of ( min over drivers of segmentTime[sector] )
Enter fullscreen mode Exit fullscreen mode

Take the fastest time anyone set through each minisector and stitch them together. It is always quicker than the actual pole, sometimes by more than a second, because no single driver strings every segment's best together on one lap. It is a clean measure of how much time was left on the track.

Where you have to be careful

This is the part worth being upfront about, because a naive version quietly lies.

Segment boundaries are a choice. Make them too long and you blur two corners into one verdict; too short and telemetry noise starts flipping the winner back and forth. There is no single correct length, only one that is honest for the track. We tune it so each segment is roughly one feature, a corner or a straight, not half of two.

Alignment is by distance, not lap distance travelled. Drivers take slightly different lines, so their raw distance-travelled differs over a lap. You align to track position (progress along the circuit), otherwise a wider line reads as "slower" purely from geometry.

It is per segment, not per driver. A colour means "fastest through this stretch," full stop. It does not mean that driver was faster overall, and the map is deliberately honest about that: a lap can be a patchwork of colours and still belong, on total time, to the driver who barely shows up on it.

Being explicit about those keeps it a useful visualisation instead of a confident-looking wrong one.

Why it reads so well

The arithmetic is almost nothing, an interpolation and an argmin. The value is entirely in the swap of representation: from a laptime, which is one opaque number, to a map, which your eye reads instantly.

Where one colour dominates, that driver was building the lap. Where it flickers between colours, the field was trading tenths corner by corner. You stop reading a time and start reading a story, and you did not have to understand a single millisecond to get it.

See it running

We built this into a live tool that colours any 2026 qualifying session on the real track shape, so you can pick a race and drivers and watch the domination map redraw:

https://www.formuladream.app/f1-interactive/tools/track-domination

It is part of Formula Dream, a free F1 companion app. But the pattern travels: any time you have parallel runs over the same course, a race, a build pipeline, an A/B rollout, splitting by position and colouring by the local winner turns "who was fastest overall" into the far more useful "who was fastest where."

Top comments (0)