Move the target
Switch the elbow branch while the target stays still. The outline shows the other valid pose. Now move the target outward until the links straighten. Beyond that circle the display marks the requested point and shows where the arm can actually reach.
The plot uses a planar mechanism with links of length and in model units. The outer radius is . The inner radius is . Switch to Orbit to inspect the same solution in three dimensions. The model lives in a horizontal plane and rotates about vertical joint axes.
Derive both solutions
At the base, measures the first link from the positive direction. At the elbow, measures the second link from the first. The law of cosines connects the target to the relative joint angle.
A cosine generally gives two angles with opposite signs. Choose a sign, then rotate the whole arm by to point the resulting triangle toward the target.
The branches meet when the links straighten or fold completely. At either boundary , so the determinant of the planar position Jacobian, , is zero. At that instant, small joint motions can produce tip velocity along only one direction. The arm is at a kinematic singularity.
Lynch and Park’s chapter on inverse kinematics puts this analytical solution in the broader context of solving for end-effector configurations.
Reproduce the result
Save arm_ik.py and run the command below. It reports both branches and checks each one with forward kinematics. Try 2.47 0 for the straight arm and 2.60 0 for an unreachable target.
python3 arm_ik.py 1.52 1.03Here is the core calculation. The tolerance protects against floating-point roundoff at the workspace boundary.
from math import acos, atan2, cos, sin
def solve(x, y, l1, l2, branch):
c2 = (x*x + y*y - l1*l1 - l2*l2) / (2*l1*l2)
if abs(c2) > 1 + 1e-12:
return None
q2 = branch * acos(max(-1.0, min(1.0, c2)))
q1 = atan2(y, x) - atan2(l2*sin(q2), l1 + l2*cos(q2))
return q1, q2A real arm also has joint limits, geometry that can collide, and a controller that can only move so fast. Those constraints influence which solution is usable as a target moves from point to point.
References and code
- Kevin M. Lynch and Frank C. Park. Modern Robotics, Chapter 6. Inverse Kinematics.
- Robot Learning Lab on GitHub contains implementations for the public Lab series. The example on this page is available as a standalone Python program.
Cite this article
Aadi Mishra. One target, two arm poses. 26 November 2026. https://aadimishra.com/writing/one-target-two-arm-poses/index.html
@misc{mishra2026onetargettwoarmposes,
author = {Mishra, Aadi},
title = {{One target, two arm poses}},
year = {2026},
month = {November},
day = {26},
url = {https://aadimishra.com/writing/one-target-two-arm-poses/index.html},
note = {Technical article on Aadi Mishra's website}
}