Home · Module 1 · Robot Kinematics

2-Link Planar Manipulator

Move the joints (forward kinematics) or drag the end-effector (inverse kinematics). The red circle shows the workspace — the set of all reachable points.

Mode

FK: set joint angles → compute hand position.
IK: drag the hand → compute joint angles.

Joint angles

45°
-60°

Link lengths

120
100

Live state

End-effector X
End-effector Y
Elbow X
Elbow Y
Reach (min)
Reach (max)
IK solution

The math behind the picture

Forward Kinematics — easy

Given joint angles θ₁ and θ₂ and link lengths L₁ and L₂, the end-effector position is:

x = L₁·cos(θ₁) + L₂·cos(θ₁ + θ₂)
y = L₁·sin(θ₁) + L₂·sin(θ₁ + θ₂)

Just trigonometry. This is the function used in FK mode above — every joint change directly computes the hand position.

Inverse Kinematics — harder

Given a target point (x, y), find joint angles. For a 2-link planar arm there's a clean closed-form solution:

r² = x² + y²
cos(θ₂) = (r² − L₁² − L₂²) / (2·L₁·L₂)
θ₂ = ±acos(cos(θ₂))              ← two solutions: elbow up / elbow down
θ₁ = atan2(y,x) − atan2(L₂·sin(θ₂), L₁ + L₂·cos(θ₂))

The ± in θ₂ gives you the two valid arm configurations. Click "Switch elbow up/down" above to flip between them.

Unreachable targets: if r > L₁ + L₂ (too far) or r < |L₁ − L₂| (too close), there's no real solution — cos(θ₂) would be outside [−1, 1]. Try dragging the hand far outside the workspace and watch the status flip to UNREACHABLE.

Degrees of Freedom (DOF)

This arm has 2 DOF (two independent joint angles), and it operates in a 2D workspace (x, y) — a perfect 2-to-2 match. The Pepper robot has 17 DOF. A typical industrial 6-axis arm has 6 DOF to fully position and orient a tool in 3D space (3 for position, 3 for orientation).