
What you need
Use the validated forward-kinematics function and a calculator. Keep this exercise completely offline.
Read the diagram as a data table
| Condition or component | degrees |
|---|---|
| A shoulder | 0 |
| A elbow | 90 |
| B shoulder | 90 |
| B elbow magnitude | 90 |
The calculation
c₂ = (x² + y² − L₁² − L₂²) / (2L₁L₂) θ₂ = atan2(±√(1 − c₂²), c₂) θ₁ = atan2(y,x) − atan2(L₂ sin θ₂, L₁ + L₂ cos θ₂)
c₂ is cos θ₂. Require |c₂|≤1 within a small numerical tolerance before evaluating the square root.
Worked example
For two 100 mm links and target (100,100) mm, c₂=0. The solutions are (θ₁,θ₂)=(0°,90°) and (90°,-90°). Both place the endpoint correctly, but their elbows occupy different regions.
Try it step by step
- Check distance and numerical reachability before evaluating inverse trigonometric functions; reject genuinely impossible requests.
- Calculate both branches and convert units only at well-defined boundaries.
- Apply joint limits and collision checks to each solution, then choose a continuous valid branch.
- Run the result through forward kinematics and compare its endpoint with the requested target.
How to check the result
The forward-then-inverse round trip should recover position within tolerance for reachable test points, including cases near workspace boundaries.
Common mistake to avoid
Clamping every out-of-range cosine into [-1,1] hides unreachable targets. Clamp only tiny floating-point excursions after a proper reachability check.
Reference reading
Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.


