SCARA reaching one target with a translucent alternate elbow configuration sharing its shoulder and endpoint.

What you need

Use the validated forward-kinematics function and a calculator. Keep this exercise completely offline.

Absolute joint angles for two valid branches. A shoulder: 0 degrees; A elbow: 90 degrees; B shoulder: 90 degrees; B elbow magnitude: 90 degrees.
Absolute joint angles for two valid branches. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentdegrees
A shoulder0
A elbow90
B shoulder90
B elbow magnitude90

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

Illustrative numbers. Replace them with your measured inputs.

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

  1. Check distance and numerical reachability before evaluating inverse trigonometric functions; reject genuinely impossible requests.
  2. Calculate both branches and convert units only at well-defined boundaries.
  3. Apply joint limits and collision checks to each solution, then choose a continuous valid branch.
  4. 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.

Read our methods, limitations and safety notes.