Inverse Kinematics 2DOF

Enter end-effector target coordinates and link lengths to compute the two joint angles of a 2-DOF planar robot arm.

Robot Parameters

Link Lengths

u
u

Target End-Effector Position

u
u

Arm Diagram

Elbow-up Elbow-down

Both solutions overlaid. Dashed circle = max reach.

Copied!

Summary

Enter end-effector target coordinates and link lengths to compute the two joint angles of a 2-DOF planar robot arm.

How it works

  1. Enter the length of the first link (L1) in any consistent unit (meters, cm, inches).
  2. Enter the length of the second link (L2) in the same unit.
  3. Enter the desired end-effector target position X and Y.
  4. The tool checks reachability: the target must lie within the annular workspace defined by |L1 - L2| and L1 + L2.
  5. Using the law of cosines, theta2 is solved from cos(theta2) = (x^2 + y^2 - L1^2 - L2^2) / (2*L1*L2).
  6. Theta1 is then derived from the atan2 formula, yielding two solutions: elbow-up and elbow-down.
  7. Both solutions are displayed numerically and rendered on a live canvas diagram.

Use cases

  • Compute joint setpoints for a 2-link robotic arm reaching a target position.
  • Verify IK solutions during mechanical design and workspace analysis.
  • Teach and learn inverse kinematics in robotics and mechatronics courses.
  • Prototype path-planning algorithms before implementing them in firmware.
  • Check reachability constraints for a given link configuration.
  • Compare elbow-up vs. elbow-down configurations for collision avoidance.
  • Validate hand-calculated IK results against a known-correct reference.
  • Explore how link length ratios affect the reachable workspace.

Frequently Asked Questions

Last updated: 2026-07-05 · Reviewed by Nham Vu