Time to phase
p = (t ÷ T) mod 1t is the time in seconds and Tthe stroke’s cycle. Freestyle takes 2.4 s, about half race tempo, so the movement can be followed. Slow motion only makes t grow slower.
How it works
The figure in Swim Companion is not a video or a motion capture. It is drawn by code, frame by frame, from a skeleton, a few curves and one solver. This page shows each part, with the numbers the app uses.
The skeleton
A swimmer about 1.8 m tall, life size. The body runs along x with the head forward, y is up with the waterline at 0, and z runs across it. Each limb is two bones; the trunk is one piece.
On a table the same figure is drawn 0.4 m long instead of 1.9 m: one scale, the same numbers.
| Trunk | 0.50 m |
|---|---|
| Neck | 0.22 m |
| Upper arm | 0.31 m |
| Forearm and hand | 0.43 m |
| Thigh | 0.45 m |
| Shin and foot | 0.47 m |
| Shoulders apart | 0.38 m |
| Hips apart | 0.20 m |
The cycle
p = (t ÷ T) mod 1t is the time in seconds and Tthe stroke’s cycle. Freestyle takes 2.4 s, about half race tempo, so the movement can be followed. Slow motion only makes t grow slower.
P(u) = h₀₀P₀ + h₁₀ΔpM₀ + h₀₁P₁ + h₁₁ΔpM₁Each hand and foot follows a handful of key points around the cycle (freestyle’s arm has eight). Between two keys the path is a cubic Hermite curve with Catmull–Rom slopes, and it wraps from the last key back to the first, so the loop never jumps.
θ = 0.66 · sin 2π(p − 0.1)In freestyle the shoulders roll up to 0.66 rad toward the pulling arm and the hips 0.38 of the same wave. The face turns with the shoulders, and once per cycle it turns further to breathe.
y = 0.13 · sin 2π · 3pThe flutter kick is a sine: three kicks per leg in each freestyle cycle, the left leg a sixth of a cycle behind the right. The knee bends as the foot rises.
The solver
The paths only say where the hand and the foot go. The elbow and the knee are solved every frame so that the upper arm and the forearm, or the thigh and the shin, keep their lengths. That is the law of cosines:
cos α = (a² + d² − b²) ÷ 2ada and b are the two bones and d the distance from the shoulder (or hip) to the hand (or foot). The joint bends toward a fixed direction for each limb: the elbow up and out, the knee down.
The five strokes
| Stroke | One cycle | Phases, in order | Legs |
|---|---|---|---|
| Freestyle | 2.4 s | Entry · Catch · Pull · Push · Recovery | flutter, three kicks per leg |
| Backstroke | 2.6 s | Entry · Catch · Pull · Push · Recovery | flutter, face up |
| Butterfly | 2.2 s | Entry · Catch · Pull · Push · Recovery | two dolphin kicks per cycle |
| Breaststroke | 2.8 s | Glide · Pull · Recovery · Kick · Glide | whip kick |
| Sidestroke | 3.0 s | Glide · Catch · Pull · Kick · Glide | scissor kick |
The phase names are what the app and the Apple Watch show while the figure swims.
Muscles and forces
Each muscle group is one to three paths from where it starts to where it ends on the skeleton. Because the two ends sit on different bones, the path changes length as the figure moves. That change is the colour:
The leg muscles start, pass and end at points taken from the OpenSim full-body model of Rajagopal et al. (2016, IEEE Transactions on Biomedical Engineering), scaled to the figure’s bones. The trunk and arm attachments are placed by hand on a simpler skeleton: they show which way each muscle goes, not measured points.
Which muscles light up is read from the lesson itself, never guessed: an exercise lists them, a stroke names them in its “What works” paragraph. The rest stay pale.
An arrow shows where the figure pushes on the world and which way: the hand sweeping back against the water, the floor under the feet in a squat. The arrows grow with the movement; they are not newtons.
The movements
A strength movement is a short list of poses, one for each frame of its lesson, that the figure moves through in a loop, with the equipment it uses. The poses are drawn from the lesson’s illustrations: they teach the shape of the movement, not exact joint angles. Turns and dives work the same way in a pool, with the wall or the block.
The interactions
A sideways drag turns the figure around its vertical axis; an up-or-down drag is left to the page, so it still scrolls.
Two fingers bring the figure closer or move it away. In AR the figure stands on the table or floor the camera finds.
Slow motion halves the tempo. The scrubber holds the cycle at any phase, so one position can be looked at from every side.
In All swims a pinch moves one view closer or further: days, months, years, dots. Once per pinch, as soon as it is clear.
Sources
The stroke and strength lessons draw on selected ideas from the book Science of Swimming(DK, 2024), lightly reworded, in English and Spanish. The book has no chapter on turns or dives, so those four lessons are the app’s own, written from research notes, and each lists its sources in the app:
Behind them sit 244 reading notes on papers, rules and coaching guides, from World Aquatics’ rules to biomechanics studies of the wall and the start. Nothing in a lesson is shown as the book’s when it is not.