Forward Kinematics Simulator Back
Robotics Simulator

Forward Kinematics Simulator — Two-Link Planar Manipulator

Compute end-effector (x, y) from link lengths L1, L2 and joint angles theta1, theta2. Visualizes arm posture, the annular workspace, and Jacobian determinant det J = L1 L2 sin(theta2) in real time.

Parameters
L1 link 1 length
cm
L2 link 2 length
cm
theta1 joint 1 angle
deg
theta2 joint 2 angle
deg
Sweeps theta1 from -180 deg to 180 deg continuously.
Results
end-effector x
end-effector y
reach r from origin
|sin theta2| = |detJ|/(L1 L2)
Arm Posture and Workspace
Joint-space Jacobian Map (theta1, theta2)
Theory & Key Formulas

End-effector position for a 2-link planar manipulator (forward kinematics):

$$x = L_1\cos\theta_1 + L_2\cos(\theta_1+\theta_2)$$ $$y = L_1\sin\theta_1 + L_2\sin(\theta_1+\theta_2)$$

Jacobian determinant (singularity indicator):

$$\det J = L_1\,L_2\,\sin\theta_2$$

Workspace radii: $|L_1 - L_2| \le r \le L_1 + L_2$. Singular configurations: $\theta_2 = 0°$ or $180°$.

What is Forward Kinematics

🙋
So forward kinematics just maps joint angles to the tool tip position? Why is it usually called the "easy" direction?
🎓
Roughly speaking, once you know every joint angle, you just plug them into trig and the end-effector position comes out — single, unique, closed-form. For this 2-link arm it is x = L1 cos t1 + L2 cos(t1 + t2). Inverse kinematics goes the other way: pick an end-effector point and solve for the joint angles, which may have several solutions or even none. In practice engineers first use FK to render the robot, then use IK to back out target angles.
🙋
The bottom-right heat map shows red dashed lines labelled "singular curves". What are those?
🎓
Good catch — that is the highlight of today. The Jacobian J tells you how a small change in joint angles maps to end-effector velocity. For this arm det J = L1 L2 sin(t2). When t2 hits 0 deg (fully stretched) or 180 deg (folded), sin(t2) is zero, so a single direction of end-effector motion needs an infinite joint speed. That is a singularity, and real machines plan paths to avoid those bands.
🙋
If I set L1 = L2 the arm seems to reach all the way back to the base. Does the ratio of link lengths matter that much?
🎓
Yes — the inner workspace radius is r_min = |L1 - L2|. With L1 = L2 the dead zone collapses to zero and the workspace is a full disc. With L1 = 30 cm, L2 = 25 cm a small ring of radius 5 cm becomes unreachable. Industrial arms tune the ratio so the dead zone never hides a useful working area.

Physical Model and Key Equations

The 2-link planar manipulator has a base joint at the origin, a first link of length $L_1$ rotated by $\theta_1$, and a second link of length $L_2$ rotated by $\theta_2$ relative to the first. The end-effector position $(x, y)$ is a sum of trigonometric terms.

$$x = L_1\cos\theta_1 + L_2\cos(\theta_1+\theta_2),\quad y = L_1\sin\theta_1 + L_2\sin(\theta_1+\theta_2)$$

Jacobian: $J = \begin{pmatrix} -L_1\sin\theta_1 - L_2\sin(\theta_1+\theta_2) & -L_2\sin(\theta_1+\theta_2) \\ L_1\cos\theta_1 + L_2\cos(\theta_1+\theta_2) & L_2\cos(\theta_1+\theta_2)\end{pmatrix}$, $\det J = L_1 L_2 \sin\theta_2$.

Reach: $r = \sqrt{x^2+y^2}$, workspace: $|L_1-L_2| \le r \le L_1+L_2$, singularities at $\theta_2 = 0°, \pm 180°$.

Real-World Applications

Industrial robot teach-replay: For welding, assembly, and pick-and-place tasks, recorded joint trajectories are visualized in pendants and simulators by computing the end-effector position via FK frame-by-frame. ROS, MoveIt, RoboDK and Tecnomatix all rely on it.

FEM/multi-body CAE setup: Stiffness, modal, and contact analyses of articulated structures need the geometry placed in a representative pose. FK provides the link coordinates from a chosen set of joint angles to position the mesh correctly before applying loads.

Surgical robots and tele-operation: Master-side joint angles are mapped to slave-side end-effector positions for overlay rendering. The closed-form FK keeps the round-trip latency low enough for direct manual control.

CG, animation, and VR rigging: Joint rotations of a character drive the visible end of a limb through FK; layered IK then offers natural target-tracking on top.

Common Pitfalls and Caveats

First, "FK is so simple precision does not matter" is wrong. Encoder resolution and link-length manufacturing tolerances feed directly into end-effector error. With L1 = L2 = 50 cm and 0.1 deg of joint noise the end-effector wobbles by roughly 0.17 mm, and the bigger the arm the worse it gets. Industrial deployments require careful kinematic calibration.

Second, "theta2 is an absolute angle" is a frequent confusion. Here theta2 is defined relative to link 1. Some textbooks instead use the absolute orientation theta2' = theta1 + theta2. Always check the convention before importing parameters from a paper or CAD file.

Third, "singularities are just a math curiosity" is dangerous. Near singularities the required joint speed grows and servos saturate, leading to oscillations or runaway behaviour. Push theta2 toward 0 deg or 180 deg in the simulator and watch the joint-space map go dim — that is the warning signal.

Frequently Asked Questions

With L1 = 30 cm, L2 = 25 cm, theta1 = 30 deg, theta2 = 60 deg, x = 30 cos 30 deg + 25 cos 90 deg = 25.98 cm (~ 26.0 cm), y = 30 sin 30 deg + 25 sin 90 deg = 40.0 cm, the reach r = sqrt(26.0^2 + 40.0^2) ~ 47.7 cm, and the normalised Jacobian |sin theta2| = sin 60 deg ~ 0.866.
Each column of J is the partial derivative of (x, y) with respect to a joint angle. Expanding the 2x2 determinant the cross terms simplify via sin(theta1 + theta2) cos theta1 - cos(theta1 + theta2) sin theta1 = sin theta2, leaving only L1 L2 sin theta2. The result is independent of theta1.
The smallest reachable distance is achieved when the links fold against each other, giving r_min = |L1 - L2|. When L1 differs from L2 a small disc of radius |L1 - L2| around the base is unreachable. Setting L1 = L2 collapses the dead zone to zero.
The colour encodes |sin theta2|, which peaks at theta2 = +/-90 deg and vanishes at 0 deg and +/-180 deg, repeating with a 180 deg period. The dashed red bands mark exactly those zero crossings (singular curves).
For an n-joint serial robot one chains homogeneous transformations (Denavit-Hartenberg parameters) and reads the end-effector position from the resulting matrix. The 2-link planar case here is the simplest instance of the same idea; 6-DOF arms such as UR5 or Fanuc M-20 follow the same algebra in 3D.