Forward kinematics: where is the hand?
A robot knows only its two joint angles. From those two numbers alone, it must know where its hand is to the millimetre. How?
About 35 min · 3 goals · Checked by automated tests
1.Why should I care?
Joint encoders measure angles, not positions. Forward kinematics (FK) turns those angles into the position of the hand, which is what the task actually cares about: a weld, a pick, a camera view. It's two link vectors added tip to tail, using everything from weeks 10 to 12.
- ◇ Compute the hand position of a two-link planar arm from its joint angles.
- ◇ Explain why link 2's absolute angle is θ1 + θ2.
- ◇ Check a forward-kinematics result against a simulation.
2.Predict
An arm with L1 = 0.5 m and L2 = 0.3 m has θ1 = 90° and θ2 = −90°. Where is the hand?
Guess first. Being wrong here is how the surprise works.
3.Discover
In 'Forward' mode with L1 = 0.5 m, L2 = 0.35 m: predict the hand position for (θ1, θ2) = (0°, 90°), (90°, 0°) and (45°, −45°) on paper, then set each pose and check. Where must θ2 be to reach the furthest point of the ring? The nearest?
Loading the interactive…
Can't use the interactive? Read a description instead
The two-link diagram draws the arm in blue from the shoulder at the centre, with a lime dot at the hand, over a purple ring showing every reachable point. In Forward mode the readout substitutes the chosen angles into both FK equations and gives the hand's x and y in metres.
4.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
L1 = 0.6 m, L2 = 0.4 m, θ1 = 0°, θ2 = 90°. What is the hand's y position, in metres?
5.Watch
→ Watch for the moment the maker draws the two links as a triangle: that's the same geometry as the equations below.
A robot builder shows how trigonometry turns a target position into joint angles on real hardware.
15 min 54 s · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
6.Understand
Two vectors, tip to tail
Link 1 points at θ1: its vector is L1(cos θ1, sin θ1). Link 2 starts at the elbow and points at θ1 + θ2, because θ2 is measured from link 1. Add them:
x = L1 cos θ1 + L2 cos(θ1 + θ2)
y = L1 sin θ1 + L2 sin(θ1 + θ2)
Relative angles add up
Each joint's encoder measures its angle relative to the previous link. The absolute direction of any link is the sum of the joint angles before it. Forgetting to add θ1 to θ2 is the most common FK error, and it gives positions that look plausible but are wrong.
Two numbers in, one position out
FK always has exactly one answer: given the angles, the hand is in one place. A two-joint planar arm has two degrees of freedom, enough to place the hand anywhere in its ring-shaped workspace but not to choose the hand's orientation too. That needs a third joint.
Explain it another way
Your shoulder sets the direction of your upper arm; your elbow bends your forearm relative to it. Where your hand ends up is 'upper arm, then forearm', added up.
FK maps joint space (θ1, θ2) ∈ T² to task space (x, y) ∈ ℝ². It is smooth and many-to-one: generally two joint configurations map to the same hand position (elbow up and down).
L1 = 0.5, L2 = 0.2, θ1 = 45°, θ2 = −90°: link 2 at −45°. x = 0.5(0.7071) + 0.2(0.7071) = 0.495, y = 0.5(0.7071) + 0.2(−0.7071) = 0.212 m.
Industrial robot controllers run FK hundreds of times a second to display the tool position, check it against safety zones and log where every weld was made.
Worked example 1
L1 = 0.4 m, L2 = 0.3 m, θ1 = 30°, θ2 = 60°. Find the hand position.
Link 2 is at 90°. x = 0.4 cos 30° + 0.3 cos 90° = 0.346 + 0 = 0.346 m. y = 0.4 sin 30° + 0.3 sin 90° = 0.2 + 0.3 = 0.5 m.
Common mix-ups
- Link 2 points at θ2.
✓ Link 2 points at θ1 + θ2, because θ2 is measured from link 1. - The hand's distance from the shoulder is always L1 + L2.
✓ Only when the arm is straight (θ2 = 0). Bending the elbow brings the hand closer.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A two-link arm has L1 = 0.3 m and L2 = 0.4 m. The shoulder is at θ1 = 15° and the elbow at θ2 = −60° (measured from link 1). What is the hand's y position, in metres? (3 decimal places)
Practice 3
θ1 = 120° and θ2 = −30°. Which way does link 2 point?
Practice 4
With θ2 = 0°, an arm of L1 = 0.5 m and L2 = 0.3 m reaches how far from the shoulder, in metres?
Practice 5 · a fresh version every time
A robot link 2.5 m long points at 110° (anticlockwise from +x). What is the x position of its tip, in metres? (3 decimal places)
Practice 6
Module check: link 1 points along (0.6, 0.8) and link 2 along (−0.8, 0.6). What is the elbow angle between them?
8.Apply it
Write fk(L1, L2, t1_deg, t2_deg) in Python returning (x, y). Test it on the worked example and on (90°, −90°). Then compare three poses against the two-link diagram to within 1 mm.
9.Reflect
10.Go further
- Forward kinematics (Wikipedia) ↗FK for longer chains and in 3D.
Concepts: Forward kinematics · Joints, degrees of freedom and workspace