Interactive: 3-Link Planar Arm IK
Move the mouse over the canvas to aim with the bullseye, then click to lock the arm onto that position. Use the orientation slider to set the desired approach angle \(\varphi\), and toggle between the two IK solutions (elbow-up / elbow-down). Adjust the link lengths with the sliders on the right.
Hover to aim · click or drag to move the arm.
Link lengths
End-effector orientation
Configuration
Joint angles
| θ₁ | — |
| θ₂ | — |
| θ₃ | — |
| — | |
Target position
| x | — |
| y | — |
The interactive panel implements the algebraic IK from Section 4 — Algebraic solution:
Step 1. Subtract the last link to get the wrist point: \[W_x = p_x - a_3\cos\varphi, \qquad W_y = p_y - a_3\sin\varphi.\]
Step 2. Apply the law of cosines to find \(\theta_2\) (the \(\pm\) sign selects elbow-up/down): \[c_2 = \frac{W_x^2+W_y^2-a_1^2-a_2^2}{2a_1 a_2}, \qquad \theta_2=\operatorname{atan2}(\pm\sqrt{1-c_2^2},\;c_2).\]
Step 3. Solve linearly for \(\theta_1\): \[\theta_1 = \operatorname{atan2}\!\left(\frac{(a_1+a_2c_2)W_y - a_2s_2 W_x}{W_x^2+W_y^2},\; \frac{(a_1+a_2c_2)W_x + a_2s_2 W_y}{W_x^2+W_y^2}\right).\]
Step 4. Close the orientation constraint: \[\theta_3 = \varphi - \theta_1 - \theta_2.\]
The dashed circle shows the reachable workspace boundary (\(r = a_1+a_2+a_3\)); the panel shows ✗ Target unreachable when \(|c_2|>1\).