Practice · Unit 4 Inverse Kinematics
Inverse kinematics
arctan2 and its quadrant trap, the 2-link arm with the cosine rule, counting solutions from the distance, and linear FK solved by Gaussian elimination. Drag a target and watch both elbows.
The method formulary · (4.7)–(4.10), Q59–63
arctan2, not arctan
arctan2 sees the signs of y and x separately, so it knows the quadrant. Casio: Pol(x, y), x first, the angle comes out as θ.
q₂ from the cosine rule (4.7)
The ± is the two elbows: q₂ > 0 elbow down, q₂ < 0 elbow up (Q63).
q₁ (4.10)
Angle to the target, minus the angle the elbow bends the line away from link 1 (Q62).
How many solutions?
- ‖X‖ > a₁ + a₂: none
- ‖X‖ = a₁ + a₂: one (q₂ = 0)
- inside: two (elbow up / down)
- ‖X‖ = 0, a₁ = a₂: infinite (q₂ = π)
One link of length a: reachable only if ‖X‖ = a (Q59).
Linear FK: X = A q
Kill one variable at a time, back-substitute, then plug q into A q to check (Q60, Q61). Casio EQN mode solves it too.
Play with it drag the target
Drill endless, mixed
Angles in degrees, between −180° and 180°. Targets are rounded to 3 decimals, so your angle only has to be within half a degree.