Lite / Textbooks / Robotics From First Principles / Chapter 5
5. Forward kinematics
Introduction
Give an arm its joint angles and forward kinematics tells you where the hand is. For a two-link planar arm it is two lines of trigonometry: the elbow sits at the end of the first link, the hand at the end of the second, with the angles adding up along the way. Sweep every allowed angle and the hand traces out the workspace: every place the arm can reach, and the holes it cannot.
Figure 5.1. Where is the hand? (described in words)
A two-link arm with links 1 m and 0.8 m at θ1 = 30° and θ2 = 45°. The elbow is at (0.866, 0.5) and the hand at (1.073, 1.273). A dashed arc marks the outer reach of 1.8 m; the inner limit is 0.2 m.
Explanation
Built from 3 School lessons. Each part is the lesson's own explanation.
5.1 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?
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.
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.
Open the Lite lesson: Forward kinematics: where is the hand?
5.2 Forward kinematics as a chain of transforms
Add a third joint, a fourth, a seventh. The trigonometry gets ugly fast. What stays simple?
One block per joint
Each joint contributes A(θᵢ, Lᵢ) = Rot(θᵢ)·Trans(Lᵢ): turn by the joint angle, then move along the new x axis by the link length. The hand's pose in the base frame is the product T_base←hand = A₁·A₂·…·Aₙ. The last column gives the position; the top-left block gives the orientation.
Same answer, more information
For two links, multiplying out reproduces x = L1 cos θ1 + L2 cos(θ1 + θ2) exactly (see the derivation). But the matrix also hands you the orientation of the hand, θ1 + θ2, and the position of every intermediate joint along the way: just stop the product early.
Why engineers prefer chains
The chain is systematic: the same block, repeated. It works unchanged for any number of joints, and in 3D (with 4×4 matrices) for real industrial arms. Conventions such as Denavit–Hartenberg parameters are a standard recipe for writing each block. Computers multiply the matrices; humans just have to get the chain right.
Derivation: Two-link FK from transforms
Joint i rotates by θᵢ: Rot(θ) = [cos θ −sin θ 0; sin θ cos θ 0; 0 0 1]. Link i slides along its own x axis: Trans(L) = [1 0 L; 0 1 0; 0 0 1].
One joint-plus-link block: A(θ, L) = Rot(θ)·Trans(L) = [cos θ −sin θ L cos θ; sin θ cos θ L sin θ; 0 0 1].
The hand frame is T = A(θ1, L1)·A(θ2, L2). Its rotation block is R(θ1)R(θ2) = R(θ1 + θ2).
Its translation column is R(θ1)·(L2 cos θ2, L2 sin θ2) + (L1 cos θ1, L1 sin θ1).
Using the angle-addition formulas, R(θ1)·(L2 cos θ2, L2 sin θ2) = L2(cos(θ1 + θ2), sin(θ1 + θ2)). So the hand is at (L1 cos θ1 + L2 cos(θ1+θ2), L1 sin θ1 + L2 sin(θ1+θ2)): the familiar formula.
A third link just multiplies one more block: T = A(θ1, L1)·A(θ2, L2)·A(θ3, L3), with orientation θ1 + θ2 + θ3.
Common mix-ups
Matrix FK and trigonometric FK can give different answers.
✓ They're the same mathematics: multiplying the matrices out gives exactly the trig formula.The chain only gives the hand position.
✓ It also gives the hand's orientation and every intermediate joint frame.
Open the Lite lesson: Forward kinematics as a chain of transforms
5.3 Mapping the workspace: everywhere the hand can go
A two-link arm with 5 cm and 3 cm fingers can never touch a point 1 cm from its knuckle. Why is there a hole in the middle?
A ring
With joints that turn all the way round, the tip's distance from the shoulder can be anything from |L1 − L2| (elbow fully folded) to L1 + L2 (arm straight). Every direction is possible, so the workspace is a ring (annulus). A target is reachable exactly when |L1 − L2| ≤ √(x² + y²) ≤ L1 + L2.
Choosing link lengths
Equal links (L1 = L2) close the hole: the tip can reach the shoulder itself. Very unequal links leave a big hole. The outer radius sets the reach; the inner radius sets how close to the base the arm can work. Designers pick lengths so the task's points sit comfortably inside the ring, away from both edges (where the arm is nearly straight or nearly folded and moves poorly).
Real joints have limits
Real joints can't turn 360°: cables, hard stops and the arm hitting itself limit them. Joint limits carve slices out of the ring, so some points become reachable only with the elbow one way, or not at all. That's why the full design check in the Gripper Build tests real target points, not just the ring.
Common mix-ups
A two-link arm can reach every point within L1 + L2 of its base.
✓ Not the points closer than |L1 − L2|: there is a hole unless the links are equal.The workspace only depends on the total length.
✓ The split between L1 and L2 sets the hole's size, and joint limits cut out more.
Open the Lite lesson: Mapping the workspace: everywhere the hand can go
Worked examples
Forward kinematics: where is the hand?: example 1
L1 = 0.4 m, L2 = 0.3 m, θ1 = 30°, θ2 = 60°. Find the hand position.
Solution
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.
Forward kinematics as a chain of transforms: example 1
Use the block form to find the elbow position (the end of link 1) for θ1 = 60°, L1 = 0.5 m.
Solution
A(60°, 0.5) has translation column (0.5 cos 60°, 0.5 sin 60°) = (0.25, 0.433) m. That's the elbow, and the frame there is turned 60°.
Mapping the workspace: everywhere the hand can go: example 1
L1 = 0.4 m, L2 = 0.25 m. Is (0.5, 0.45) m reachable?
Solution
Distance √(0.25 + 0.2025) = √0.4525 ≈ 0.673 m. Ring: 0.15 to 0.65 m. 0.673 > 0.65, so no: it's 0.023 m beyond full stretch.
Interactive figures, in words
Figure 5.2 from Forward kinematics: where is the hand?
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?
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.
Laboratory
These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.
- Simulation OS: Two-link robot arm reach (Simulation OS experiment)
Set three pairs of joint angles, predict the gripper position by hand, then check each in the model.
Open on the full site - Nexus: Virtual Robotic Arm (Nexus project)
Map the arm's workspace and mark one point it can never reach.
Open on the full site
Practice
Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.
- L1 = 0.6 m, L2 = 0.4 m, θ1 = 0°, θ2 = 90°. What is the hand's y position, in metres?
Answer it in “Forward kinematics: where is the hand?” - θ1 = 120° and θ2 = −30°. Which way does link 2 point?
Answer it in “Forward kinematics: where is the hand?” - With θ2 = 0°, an arm of L1 = 0.5 m and L2 = 0.3 m reaches how far from the shoulder, in metres?
Answer it in “Forward kinematics: where is the hand?” - Why is each block Rot(θ)·Trans(L) and not Trans(L)·Rot(θ)?
Answer it in “Forward kinematics as a chain of transforms” - L1 = 0.45 m and L2 = 0.3 m. What is the inner radius of the workspace ring, in metres?
Answer it in “Mapping the workspace: everywhere the hand can go” - Why do many arms use roughly equal link lengths?
Answer it in “Mapping the workspace: everywhere the hand can go” - An elbow can only bend between 0° and 150°. What happens to the workspace?
Answer it in “Mapping the workspace: everywhere the hand can go”
Engineering applications
Pick and place cells
Before a factory installs a robot arm, engineers check that every pick and drop point lies inside its workspace with margin. A part placed just outside the reach is a part the robot can never collect.
Digital checks
Animation rigs, excavators and surgical robots all compute forward kinematics continuously, to display the tool's position and to stop the tool before it reaches somewhere it must not go.
Watch (optional)
Streaming video uses a lot of data. Everything you need is in the text.
- “Modern Robotics, Chapter 4: Forward Kinematics Example” by Northwestern Robotics
- “Modern Robotics, Chapter 2.5: Task Space and Workspace” by Northwestern Robotics
Summary
- Forward kinematics maps joint angles to the hand position.
- For two links: x = L1 cos θ1 + L2 cos(θ1 + θ2), y = L1 sin θ1 + L2 sin(θ1 + θ2).
- The same answer comes from multiplying one transform per joint.
- The workspace of two links is a ring between |L1 − L2| and L1 + L2, cut down by joint limits.
Glossary
- Forward kinematics (two-link arm)
- Forward kinematics computes where the end-effector is from the joint angles and link lengths. Field Guide
- Workspace and reach
- A robot's workspace is the set of all positions its end-effector can reach. For a two-link planar arm it is a ring between radii |L1 − L2| and L1 + L2. Field Guide
- End-effector
- The end-effector is the device at the end of a robot arm that interacts with the world: a gripper, suction cup, welding torch, camera or pen. Field Guide
- Degrees of freedom
- The degrees of freedom of a mechanism are the number of independent ways it can move. A rigid body free in space has 6: three translations and three rotations. Field Guide
- Sine, cosine and tangent
- In a right-angled triangle, sine is opposite over hypotenuse, cosine is adjacent over hypotenuse and tangent is opposite over adjacent, each a function of the angle. Field Guide
Project: Workspace map
Write a program that sweeps both joints of a two-link arm through their limits in 5° steps and plots every hand position. Choose link lengths and joint limits for a real task, such as reaching the four corners of an A4 sheet, and show whether the arm can do it.
Deliverables
- The sweep program
- A plot of the reachable points with the task targets marked
- A verdict on whether the arm suits the task
Write it up on paper or in your own notes. Lite never stores what you write.
References
- Kevin M. Lynch and Frank C. Park (2017). Modern Robotics: Mechanics, Planning, and Control. Cambridge University Press.
- John J. Craig (2005). Introduction to Robotics: Mechanics and Control, 3rd edition. Pearson Prentice Hall.
Further reading from the lessons
- Forward kinematics (Wikipedia)
FK for longer chains and in 3D. - Denavit–Hartenberg parameters (Wikipedia)
The standard recipe for writing one transform per joint in 3D. - Annulus (Wikipedia)
The ring shape, its area and properties.