Click anywhere on the canvas to set a target position. The 3-joint planar robot arm will use Jacobian transpose inverse kinematics to move its end-effector towards that point in real time.
// Forward kinematics (2D) P0 = base P1 = P0 + L1·[cos(θ1), sin(θ1)] P2 = P1 + L2·[cos(θ1+θ2), sin(θ1+θ2)] P3 = P2 + L3·[cos(θ1+θ2+θ3), sin(θ1+θ2+θ3)] // Jacobian column i (2D revolute) Jx_i = -(P_ee.y - P_i.y) Jy_i = +(P_ee.x - P_i.x) // Jacobian transpose IK step dθ = α · J^T · e θ_new = clamp(θ_old + dθ, θ_min, θ_max)
The Jacobian transpose method was independently discovered in robotics and animation. Unlike pseudo-inverse methods, it requires no matrix inversion and is always numerically stable, making it popular in real-time character animation and game engines.
What is forward kinematics in robotics?
Forward kinematics (FK) computes the position and orientation of a robot's end-effector given known joint angles. For a planar 3-joint arm, each joint contributes a rotation compounding through the chain: P = T0 · T1 · T2, where each Ti encodes a link translation and a joint rotation.
What is inverse kinematics and why is it harder than FK?
Inverse kinematics (IK) finds joint angles that place the end-effector at a desired position. It's harder because the mapping from Cartesian space to joint space can be non-unique (multiple solutions), have no solution (outside workspace), or be ill-conditioned near singularities.
How does the Jacobian transpose method work?
The Jacobian J maps joint velocities to end-effector velocities: v = J · dθ/dt. The Jacobian transpose method uses dθ = α · JT · e, where e is the position error. It's cheap (no inversion) and naturally handles redundancy, though convergence slows near singularities.
Singularities occur when the Jacobian loses rank — the robot loses a degree of freedom. In planar arms this happens when links are fully extended or folded. This simulation uses damped steps with constant λ to prevent infinite joint velocities near singular configurations.
Joint limits define the physically achievable range of motion for each joint (here ±150°). Exceeding them in hardware causes collisions or damage. After each IK iteration joint angles are clamped to their limits, which may prevent convergence to unreachable targets.
SCARA (Selective Compliance Assembly Robot Arm) has 4 DOF — 3 rotary joints in a planar configuration plus a vertical axis. This simulation models the planar 3-joint portion, which is representative of SCARA kinematics and widely used in electronics assembly.
DH parameters are a standardised convention (a, α, d, θ) for describing kinematic chains. For planar revolute joints α=0 and d=0, reducing the description to link length a and joint angle θ — exactly what this simulation uses for its 3-joint arm.
For a 3-joint planar arm with link lengths L1, L2, L3 the outer reachable boundary is a circle of radius L1+L2+L3. The inner boundary radius is |L1−L2−L3|. Joint limits further restrict the reachable region. Points outside this annulus cause the IK solver to stall at the workspace boundary.
Position-only IK (as used here) targets only x,y — 2 constraints for 3 joints, leaving one degree of redundancy. Full pose IK also constrains end-effector orientation (angle), consuming all 3 DOF with zero redundancy in a planar 3-joint arm.
The solver fails to converge when the target is outside the workspace, when the configuration is singular with insufficient damping, or when joint limits prevent reaching the target. The status indicator turns red for unreachable targets and orange while actively solving.
This page models a planar 3-joint robot arm and solves inverse kinematics live as you click: every frame it runs the Jacobian transpose method, nudging joint angles θ₁, θ₂, θ₃ so the gripper's end-effector converges on your target point. Forward kinematics builds each joint's position from cumulative link rotations and a fixed link length, whilst a damping term stops the solver from blowing up near singular, fully-stretched configurations. Joint limits of ±150° are enforced every iteration, so some targets near the workspace boundary are simply unreachable.
A 3-link arm chasing a clicked target using Jacobian transpose inverse kinematics, with live joint angles, position error and iteration count, plus a dashed circle marking the outer edge of the reachable workspace.
Click or drag anywhere to set a target. The α slider (0.05–2.0) sets the IK step size, the λ slider (0.0–1.0) sets singularity damping, and the link-length slider (60–160px) resizes all three equal links at once. Pause, Reset and Info buttons sit below.
The Jacobian transpose method needs no matrix inversion, so it can never blow up numerically — that's why it's a favourite in real-time game and character-animation rigs, not just industrial robotics.
Forward kinematics computes the end-effector's position from known joint angles. Here each joint's position is built by accumulating rotations θ₁, θ₂, θ₃ and stepping a fixed link length along each resulting direction, chaining from the base outward.
Forward kinematics has one unique answer for any set of joint angles. Inverse kinematics works backwards from a target position, and that mapping can have many valid solutions, none at all if the point lies outside the workspace, or become unstable near singular arm poses.
Each frame the solver measures the error between the gripper and the target, builds a Jacobian matrix relating joint motion to end-effector motion, and nudges the joint angles by a step proportional to the Jacobian transpose times that error, repeating until the error is tiny or a per-frame iteration cap is hit.
When the arm is fully stretched or folded back on itself, the Jacobian loses rank and ordinary steps would demand impossibly large joint velocities. A damping term, scaled by λ, shrinks the effective step size in these poses so the arm slows down smoothly instead of jittering.
Two limits apply: the outer workspace boundary, a circle of radius equal to the sum of the three link lengths (clicks beyond it are clamped inward), and the ±150° joint limits, which clamp every angle after each iteration and can leave some interior points unreachable too.