Calculate the position of a two-link robot arm
This forward kinematics calculator finds the tip position of a planar arm with two rotating joints. Enter the link lengths, move the base and elbow angle sliders, and the drawing updates with the end-effector coordinates. It is useful for checking a robotics assignment, understanding relative joint angles or exploring the workspace of a small tabletop arm.
The forward tab models a 2R arm: two revolute joints moving in one plane. Length inputs and the reported X/Y position use millimetres. The diagram shows the base, elbow and tip; its scale adjusts to the link lengths so the arm stays visible. Use the numerical coordinates for measurements rather than estimating distances from the drawing on your screen.
The tool also has separate inverse-kinematics, holding-torque and DH sections. These solve different parts of an arm problem. The forward view itself uses two links and two joint angles; it does not provide a general spatial robot or a three-link forward input panel.
Understand the joint angle convention
The base angle θ1 is measured counterclockwise from the positive X axis. The elbow angle θ2 is measured relative to the direction of the first link. Therefore the second link's direction relative to the fixed axes is θ1 + θ2. A zero elbow angle means the two links continue in a straight line.
This convention is the most important detail when checking a hand calculation. If your sketch gives the second link's absolute direction, convert that direction into an angle relative to link one before entering it. Using two absolute headings as joint angles makes the tool add the base rotation twice.
Positive Y points upward in the mathematical coordinates. The browser drawing converts these coordinates to its screen system internally. A tip drawn above the base therefore has a positive Y result, even though raw screen pixel positions increase downward. Negative slider values rotate clockwise relative to the corresponding reference direction.
The forward kinematics formulas
For link lengths L1 and L2, the elbow coordinates are x1 = L1 cos θ1 and y1 = L1 sin θ1. The tip coordinates are x = L1 cos θ1 + L2 cos(θ1 + θ2) and y = L1 sin θ1 + L2 sin(θ1 + θ2). Each term is the horizontal or vertical projection of a link.
The sliders are in degrees. The calculation library converts angles into radians before evaluating sine and cosine. If you reproduce the formulas in a programming language, check the trigonometric function's expected unit. A degree/radian mismatch can produce a plausible-looking number with the wrong position.
These formulas assume rigid links and ideal revolute joints. They do not include joint backlash, bending, motor calibration offsets or a gripper offset beyond the second link. If a physical tool extends past that endpoint, define the geometry consistently before comparing a measured tip position with this result.
Worked example using the default pose
The default link lengths are L1 = 100 mm and L2 = 80 mm, with θ1 = 45° and θ2 = 45°. Because the elbow angle is relative, the second link points at 90° to the positive X axis. The values below were computed with the same planar-arm library used by the simulator.
| Point or setting | X coordinate | Y coordinate |
|---|---|---|
| Base | 0 mm | 0 mm |
| Elbow at the default pose | 70.71 mm | 70.71 mm |
| Tip at the default pose | 70.71 mm | 150.71 mm |
| Tip with θ1 = 0°, θ2 = 0° | 180 mm | 0 mm |
| Tip with θ1 = 0°, θ2 = 90° | 100 mm | 80 mm |
| Tip with θ1 = 0°, θ2 = 180° | 20 mm | approximately 0 mm |
The fully folded case illustrates why the endpoint does not necessarily return to the base: the link lengths differ. Tiny nonzero values near a theoretical zero can arise from floating-point trigonometry. The result display rounds coordinates to two decimal places, which is adequate for comparing these examples.
Read the reachable workspace
For ideal links with unrestricted rotation, the tip's distance from the base lies between |L1 − L2| and L1 + L2. With the example lengths, those distances are 20 mm and 180 mm. The outer limit occurs when the arm is straight; the inner limit occurs when the links fold back against each other.
A physical arm may have a smaller workspace because of joint stops, collisions, cable routing and nearby objects. The drawing does not detect those restrictions. Treat its poses as geometric configurations rather than proof that your hardware can safely move through the same path.
If your assignment starts with a desired X/Y position, switch to the inverse kinematics calculator. That tool checks reachability and offers elbow branches. Forward kinematics instead starts with known angles and produces a single corresponding position.
Check your result before using it
Keep every length in the same unit and enter millimetres in this interface. The inputs enforce a minimum link length of 10 mm, so a smaller entered value will be adjusted. Measure links between their joint axes rather than along the outside edge of a bracket or servo housing.
Check the zero pose first, then bend the elbow while keeping the base fixed. This separates a coordinate-convention mistake from an arithmetic mistake. Copy the result when recording an experiment: the copied text includes link lengths, both joint angles and the calculated endpoint.
Position alone does not tell you whether the joints can hold the load. Continue with the robotic joint torque calculator when choosing actuators. For coordinate frames and transformation matrices, use the DH parameters calculator and the DH parameters guide.