← All demos
Capability 10
Solve a robot arm, or tell me why you cannot
Drag a target. Joint angles are solved from the geometry, and unreachable targets are reported.
- JavaScript
- trigonometry
- SVG
- pointer and keyboard input
ready
KINEMATICS · no data leaves your browser unencrypted
A two-link arm, solved properly.
The joint angles come from the law of cosines, and the arm is then drawn from those angles, so what you see is the solution rather than an animation of one. The interesting part is the failure: push the target inside the minimum reach or beyond the maximum reach and there is no solution, so the interface says which rather than silently clamping the arm somewhere it was not asked to go.
Drag with a pointer or drive it from the keyboard. Presets include a deliberately unreachable target.