# Tutorial CS-11: From keypoints to a knee angle over a stride

Turn a keypoint table into a knee angle, gate it, beat the left–right swaps, line the cycles up and average them into one curve with an error band, and find out which part of the curve is a measurement.

Address: https://apopt.com/data/tutorials/cs11-knee-angle/  
License: CC BY 4.0  
Prepared: 2026-12-03

## Description

Files for the tutorial *From keypoints to a knee angle over a stride* (https://apopt.com/course/tutorials/cs11-knee-angle/). `raw/` holds the inputs as the device or app wrote them; `clean/` holds the cleaned copies the tutorial writes; `expected/` holds what a correct run prints and saves, so you can check your own run.

## Files

| file | size | rows | description |
|---|---|---|---|
| [clean/knee_curve_x.csv](https://apopt.com/data/tutorials/cs11-knee-angle/clean/knee_curve_x.csv) | 562 B | 35 rows | Cleaned copy written by the tutorial |
| [clean/swing_knee_n.csv](https://apopt.com/data/tutorials/cs11-knee-angle/clean/swing_knee_n.csv) | 3.3 KB | 117 rows | Cleaned copy written by the tutorial |
| [clean/swing_knee_s.csv](https://apopt.com/data/tutorials/cs11-knee-angle/clean/swing_knee_s.csv) | 3.3 KB | 117 rows | Cleaned copy written by the tutorial |
| [clean/swing_knee_x.csv](https://apopt.com/data/tutorials/cs11-knee-angle/clean/swing_knee_x.csv) | 3.2 KB | 117 rows | Cleaned copy written by the tutorial |
| [expected/printed-output.txt](https://apopt.com/data/tutorials/cs11-knee-angle/expected/printed-output.txt) | 1.1 KB |  | Everything the tutorial prints, cell by cell |
| [raw/form3_30fps_yolo26n-pose.csv](https://apopt.com/data/tutorials/cs11-knee-angle/raw/form3_30fps_yolo26n-pose.csv) | 43.4 KB | 117 rows | the same clip with the nano model, YOLO26n (117 rows) |
| [raw/form3_30fps_yolo26s-pose.csv](https://apopt.com/data/tutorials/cs11-knee-angle/raw/form3_30fps_yolo26s-pose.csv) | 42.6 KB | 115 rows | the same clip with the small model, YOLO26s (115 rows; two frames without a person) |
| [raw/form3_30fps_yolo26x-pose.csv](https://apopt.com/data/tutorials/cs11-knee-angle/raw/form3_30fps_yolo26x-pose.csv) | 106.8 KB | 117 rows | keypoints of every frame of a hand-drawn runner seen from the side, YOLO26x (117 rows, 52 columns) |

Large files are stated with their size. A `preview.md` in this folder shows the first rows of each table.

## Columns

| column | unit | meaning |
|---|---|---|
| frame | count | frame number from 0 at 30 frames per second |
| <joint>_x, <joint>_y | pixels from the top-left corner; y grows downward | keypoint position, 17 joints (nose … r_ankle) |
| <joint>_c | 0 to 1 | the model's confidence in that keypoint |

## Provenance

- Source: Data-Driven Athletics tutorials (IRSRI, 2027)
- Removed: nothing; inputs are synthetic, published course data, or the instructor's own
- Permission basis: Published with the course under CC BY 4.0
- Prepared with: dda/tutorials/build.py

## Used in

- Book: [Chapter 8: Seeing Movement: Video and Pose Estimation](https://apopt.com/book/ch08-pose/)
- Course: [Week 8 lesson](https://apopt.com/course/week/8/)
- Homework H16: [https://apopt.com/course/assess/h16/](https://apopt.com/course/assess/h16/)
- Homework H17: [https://apopt.com/course/assess/h17/](https://apopt.com/course/assess/h17/)

## How to cite

Tutorial CS-11: From keypoints to a knee angle over a stride. IRSRI Sports Research Institute, 2026. Data-Driven Athletics data repository. https://apopt.com/data/tutorials/cs11-knee-angle/

## Load it

```python
import pandas as pd
df = pd.read_csv("https://apopt.com/data/tutorials/cs11-knee-angle/raw/form3_30fps_yolo26n-pose.csv")
```
