跪拜 Guibai
← All articles
Frontend · JavaScript

Pinned-Foot Dance Move Produces 15x Larger Center-of-Gravity Excursion, Two-Link IK Model Shows

By 炫酷的大高个 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A simple two-link IK model converts a qualitative dance instruction into a testable geometric claim, giving developers a reusable template for turning a physical claim into a reproducible calculation with minimal code. The accompanying zero-dependency demo shows how to communicate a physical intuition without a build step or external model files.

Summary

A two-link IK model with just three points—ankle, knee, hip—separates two ways of performing a flash step from Chinese folk dance. When the foot is pinned and the upper body sways alone, the center of gravity projection peaks at 18.00 cm away from the support foot; when the hip translates in sync with the ankle, the peak is only 1.19 cm. That's a 15.13x ratio on excursion, and the approximate bending moment at the knee scales the same way, 71.16 N·m versus 4.72 N·m.

The model samples 61 points over one sinusoidal period for both modes, with fixed thigh and shank lengths and a hip height chosen by scanning to land in the reported 'semi-flexed' knee range. A pure Python script (standard library only) runs the numbers, and a zero-dependency Canvas demo runs the same equations in the browser, with the two implementations checked digit-for-digit against each other. The article also documents six pitfalls, from the reverse-joint IK solution to y-axis flipping in Canvas, and connects the solver to game industry IK (Foot IK, QWOP, Rain World).

Takeaways
— A two-link model with ankle, knee, and hip points, with fixed thigh and shank lengths (0.45 m and 0.43 m) and hip height 0.72 m, yields a 15.13x difference in peak center-of-gravity excursion between a pinned-foot and a synchronized whole-body movement.
— Peak excursion is 18.00 cm for the pinned-foot mode versus 1.19 cm for the clean mode; the approximate bending moment at the knee is 71.16 N·m versus 4.72 N·m, a 15.08x ratio.
— The bending moment scales linearly with excursion at about 3.95 N·m per cm, with upper-body weight fixed at 395.34 N (using 65 kg body mass and a 0.62 upper-body mass fraction).
— The inverse knee solver produces two mirror solutions; fixing the front solution yields a 0% frame ratio of knee behind ankle, while the back solution gives 100%, so an assertion on that ratio catches regressions.
— Hip height was chosen by sweeping 0.62–0.86 m; only 0.72 m reproduces the reported 'semi-flexed' knee range (70.2–74.0°).
— The zero-dependency Canvas demo uses timestamp normalization `(ts / 1600) % 1` to decouple animation speed from refresh rate, and flips the y-axis with subtraction to handle Canvas's downward-pointing coordinate system.
— The model's numbers are called 'approximate bending moment' and explicitly exclude ligament force, muscle activation, and 3D torsion; the 15x is a geometric magnitude, not a clinical risk estimate.
Conclusions

Choosing a 3-point geometric model over full pose estimation trades realism for explainability: every output traces to a formula, making the causal chain visible even when the model ignores torsion and muscles.

The 15x ratio is a geometric magnitude, not an injury probability, and the article explicitly refuses to let it become clinical advice—a discipline worth copying in any engineering calculation that touches health.

The connection to game IK (Foot IK, QWOP, Rain World) puts the solver in a familiar frame: the same inverse kinematics runs in engines every frame. Treating a dance move as a two-link IK problem lets any developer who has debugged foot placement reason about it directly.

Writing the reverse-joint solution into a failure log and adding an assertion on knee-behind-ankle frame ratio is a practical habit that prevents a reintroduced bug from silently corrupting future results.

Concepts & terms
Two-link inverse kinematics
Given the positions of two endpoints (e.g., ankle and hip), solve the joint angle of an intermediate joint (knee) by treating the two segments as rigid links of fixed length. Standard in game foot IK, robotic legs, and procedural animation.
Reverse-joint solution
The two-link IK equation yields two mirror solutions for the knee joint; the 'back' solution places the knee behind the ankle and appears hyperextended. Must be filtered out by choosing the front solution or an assertion on placement.
Center-of-mass projection
The horizontal distance from the support point to the vertical line through the center of mass. When this projection leaves the support polygon, gravity creates a toppling moment; small in clean movement, large when the foot is pinned.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗