Work out inverse kinematics (2 link) instantly with clear inputs, formula shown and shareable results.
For a planar two-link arm the elbow angle comes from the cosine rule, cos(theta2) = (d squared - L1 squared - L2 squared)/(2 L1 L2), and the shoulder angle from the target bearing minus the internal triangle angle. Two solutions always exist — elbow up and elbow down — and this returns the elbow-up branch.
Two-link IK
cos(theta2) = (x^2 + y^2 - L1^2 - L2^2) / (2 L1 L2); theta1 = atan2(y,x) - atan2(L2 sin t2, L1 + L2 cos t2)
The triangle formed by the links and the target can fold either way. Real controllers pick the branch that avoids collisions and stays away from the singularity.
The two solutions merge and the arm is singular: the Jacobian loses rank, so no joint motion can move the tool radially outward.