A rigid 2-link planar arm is pinned at a fixed shoulder. Reaching any target point (tx,ty) is solved analytically — no iteration, no simulation of motors — with the standard 2-link inverse-kinematics closed form:
dx,dy = target − shoulder
d = √(dx² + dy²) // clamped to [|L1−L2|, L1+L2]
θ2 = acos( (d² − L1² − L2²) / (2·L1·L2) )
θ1 = atan2(dy,dx) − atan2(L2·sinθ2, L1+L2·cosθ2)
In Auto mode a finite-state machine drives the target point through a pick-and-place cycle — wait for a part on the belt, reach, grab, lift, move to the build stack, place, weld (spark burst), retreat — exactly like the 3D version's forward-kinematics pose chain, except every pose here is computed live from the IK solver rather than hand-tuned joint angles. Shrink L1+L2 below the distance to the stack and the target is clamped to the arm's maximum reach — the readout flags it, showing the same workspace-limit problem real robot-cell designers have to solve. Switch to Manual IK aim to drag the end-effector anywhere with the mouse and watch θ1/θ2 solve in real time.
- Belt — parts travel right at the belt-speed slider's rate until they enter the pickup zone.
- Cycle speed — scales how fast the FSM moves through each phase.
- Sparks — a small gravity-driven particle burst fires at the weld phase, same as the 3D scene.