HomeArticlesRobotics & Kinematics

Forward & Inverse Kinematics for Robot Arms

Forward kinematics asks "given joint angles, where is the end-effector?" Inverse kinematics asks the opposite — and it's vastly harder. Every industrial robot and game character relies on both.

mysimulator teamUpdated July 2026≈ 8 min read▶ Open the simulation

FK vs IK

Forward kinematics takes joint angles θ₁…θₙ as input and produces the end-effector's position directly — always a unique, fast trigonometric computation, O(n) for n joints. Inverse kinematics takes a desired end-effector position and solves for the joint angles that reach it — the output may have zero, one, or infinitely many solutions, and it's generally non-linear and iterative. FK drives simulation and playback; IK drives interactive control — "move the hand to this bolt." Most real-time systems combine both: FK for the body, IK for hands and feet.

2-link arm forward kinematics:
x = L₁cos θ₁ + L₂cos(θ₁+θ₂)
y = L₁sin θ₁ + L₂sin(θ₁+θ₂)

2-link inverse (law of cosines, closed-form):
cos θ₂ = (x²+y²−L₁²−L₂²) / (2L₁L₂)   → "elbow up" / "elbow down"
θ₁ = atan2(y,x) − atan2(L₂sinθ₂, L₁+L₂cosθ₂)

3D: Denavit-Hartenberg parameters

In 3D, each joint is described by four DH parameters — link length a, link twist α, link offset d, and joint angle θ — combined into a 4×4 transformation matrix Tᵢ. The total forward kinematics is the product T₀ₙ = T₁·T₂·…·Tₙ, whose final column gives the end-effector position and whose upper-left 3×3 block gives its orientation. A 6-DOF industrial arm (KUKA, UR5) chains six of these matrices together; 6R robots with the right geometry admit analytical IK solutions with up to 16 possible configurations.

live demo · a 3-joint arm reaching via Jacobian transpose inverse kinematics● LIVE

Jacobian, CCD and FABRIK

For chains with no closed-form solution, the Jacobian J relates small joint changes to small end-effector movements: δx = J·δθ, solved iteratively via δθ = J⁺·δx using the pseudoinverse, damped least squares (adds λ²I to avoid blow-ups near singularities), or the cheaper transpose method δθ = Jᵀ·δx. Cyclic Coordinate Descent (CCD) rotates one joint at a time, from tip to root, moving the end-effector maximally toward the target each step — simple and fast, but prone to unnatural poses. FABRIK works directly on joint positions with alternating forward and backward passes, typically converging in 3-10 iterations, often under a millisecond, with no matrix inversion at all — which is why it dominates games and procedural animation.

Redundancy and real-world constraints

When a chain has more degrees of freedom than the task requires — 7 joints for a 6D target — the system is redundant: infinitely many solutions exist, and the null space of J can be used to satisfy secondary objectives like obstacle avoidance or staying away from joint limits while still reaching the target. Real IK always layers on joint constraints (a human elbow bends 0°-145°, not 360°), collision avoidance, and singularity handling — production solvers like Unity's Animation Rigging and Unreal's IK Rig combine FABRIK with constraint projection and blending. Surgical robots like da Vinci use tightly constrained IK to map surgeon hand movements to small-scale instrument motions through narrow ports.

Frequently asked questions

What is the difference between forward and inverse kinematics?

Forward kinematics takes joint angles as input and computes the end-effector's position and orientation directly — always a unique, fast trigonometric calculation. Inverse kinematics takes a desired end-effector position as input and solves for the joint angles that produce it, which may have zero, one, or infinitely many solutions and generally requires iterative, non-linear solving.

What are Denavit-Hartenberg parameters?

DH parameters describe each joint in a 3D robot arm with four values — link length a, link twist alpha, link offset d, and joint angle theta — combined into a single 4x4 transformation matrix per joint. Multiplying the matrices for all joints together gives the total forward kinematics, with the final column giving the end-effector's position.

Why is FABRIK preferred over Jacobian methods for real-time animation?

FABRIK repositions joint points directly and converges in about 3-10 iterations, often under a millisecond, without ever inverting a matrix. Jacobian pseudo-inverse methods require matrix inversion at every step and can behave unstably near kinematic singularities, making FABRIK the more robust and popular choice for games and procedural animation.

Try it live

Everything above runs in your browser — open Robot Arm Kinematics and click anywhere to move a 3-joint arm's end-effector via Jacobian transpose inverse kinematics, handling singularities and joint limits in real time.

▶ Open Robot Kinematics simulation

What did you find?

Add reproduction steps (optional)