Tap the table or use the sliders to set the target, then Run.
The science
Forward kinematics of the two-link planar arm (angles in degrees, lengths in mm):
x = l1 cos q1 + l2 cos(q1 + q2)
y = l1 sin q1 + l2 sin(q1 + q2)
Inverse kinematics by the law of cosines, two branches (elbow up and elbow down), kept only inside the joint limits:
cos q2 = (x^2 + y^2 - l1^2 - l2^2) / (2 l1 l2)
q1 = atan2(y, x) - atan2(l2 sin q2, l1 + l2 cos q2)
Reachable set: the annulus |l1 - l2| <= r <= l1 + l2. Dexterity is |sin q2|; it vanishes at the singular, fully stretched or folded poses.
A pose is safe when the distance from every obstacle centre to both link segments exceeds obstacle radius + link radius + clearance. The planner searches the 2D joint space (q1, q2) with A* on a 5 degree grid, 8 neighbours, continuous edge checks, then smooths the path; the arm moves with its fastest joint at the set speed along each joint-space segment.
Simplifications. Planar kinematics only: no dynamics, torque limits, vertical motion or self-collision; links are capsules, obstacles are infinite vertical cylinders, joint motion is linear in joint space, grid resolution limits path optimality.
Educational model. Planner, kinematics and checks are those of the 2D companion.