gitwtfhub

wtf is turning_density_f1?

mchmiel21/turning_density_f1 — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · dataComplexity · 2/5Setup · easy

TL;DR

A Python tool that measures how twisty or straight F1 race tracks are, using real qualifying telemetry data.

Mindmap

mindmap
  root((Turning Density F1))
    What it does
      Measures track turning complexity
      Weights turns by lateral G force
      Uses real qualifying telemetry
    Tech stack
      Python
      fastf1
      pandas and NumPy
      matplotlib and seaborn
    Use cases
      Rank circuits by twistiness
      Compare tracks across years
      Generate ranking charts
    Audience
      F1 data fans
      Motorsport analysts
      Python hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Rank F1 circuits by how twisty or straight they are for a given season.

REASON 2

Compare how a track's turning profile changes across multiple years.

REASON 3

Generate visual charts and circuit maps colored by speed or cornering force.

What's in the stack?

Pythonfastf1pandasNumPymatplotlibseabornpyarrow

How it stacks up

mchmiel21/turning_density_f10xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity2/54/54/5
Audiencedatadeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Just needs Python and a few pip-installable data libraries, no external services.

Wtf does this do

This project analyzes how twisty or straight Formula 1 race tracks are, using real telemetry data from qualifying sessions. It introduces two custom metrics: Turning Density, which measures how much a car's direction changes over the length of a lap, and Lateral G Weighted Turning Density, which adjusts that number based on how much sideways force the car experiences in each turn. A track with a higher score is more twisty and demanding, while a lower score means a straighter, faster circuit. The code is split into two main scripts. One script, compute_TD_and_LGWTD.py, pulls telemetry from every valid qualifying lap for a chosen F1 season and calculates both metrics for each circuit. The only thing a user needs to set is the year they want to analyze. The second script, make_plots.py, takes that computed data and turns it into charts and images, including bar charts ranking circuits, side by side comparisons across different years at the same track, and grid layouts of circuit maps colored by speed or lateral force. The project produces both raw data files, such as CSV and Parquet files with the computed rankings and coordinate traces, and visual outputs like the bar charts and circuit maps described above. It relies on the open source Fast F1 Python package to get the underlying telemetry, and borrows some calculation logic from another public project for estimating lateral forces. The author is upfront about the limits of this approach. Because Fast F1 provides normalized track positions rather than true GPS coordinates, and because it lacks banking angle data, the lateral force numbers can be somewhat overestimated on banked corners. The metrics also shift from year to year as cars and regulations change, so they are best used for relative comparisons rather than as exact physical measurements. To run it, you need Python along with a handful of common data science libraries: fastf1, numpy, pandas, pyarrow, matplotlib, and seaborn. This is an independent, unofficial fan project and is not affiliated with Formula 1 or its associated trademarks.

Yoink these prompts

Prompt 1
Explain how the Turning Density metric in this repo is calculated from lap telemetry.
Prompt 2
Help me modify compute_TD_and_LGWTD.py to analyze a different F1 season.
Prompt 3
Walk me through installing fastf1 and the other dependencies this project needs.
Prompt 4
Show me how make_plots.py turns the computed CSV data into circuit map images.

Frequently asked questions

wtf is turning_density_f1?

A Python tool that measures how twisty or straight F1 race tracks are, using real qualifying telemetry data.

What language is turning_density_f1 written in?

Mainly Python. The stack also includes Python, fastf1, pandas.

How hard is turning_density_f1 to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is turning_density_f1 for?

Mainly data.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.