This simulation drives a multi-segment robotic arm using inverse kinematics: instead of setting joint angles by hand, you set a target and the solver computes the angles needed to reach it. You can switch between two classic iterative methods — FABRIK (Forward And Backward Reaching Inverse Kinematics) and CCD (Cyclic Coordinate Descent). Both honour fixed segment lengths and repeat passes until the tip lands close to the goal, illustrating how robots translate a desired hand position into joint motion.
A kinematic chain of 2 to 6 rigid segments anchored at a fixed base. FABRIK alternates a forward pass (place the tip on the target, then pull each joint back along the chain keeping its length) with a backward pass (re-anchor the root, push joints outward). CCD instead rotates each joint, working from the tip to the base, to align its sub-chain with the target. Both stop within a 0.5 px tolerance or after 30 iterations.
Drag the red cross-hair target anywhere on the canvas and watch the arm follow. The Segments slider sets the joint count (2–6) and Segment length sets each link (50–120 px). Toggle FABRIK or CCD to compare solvers, try the Reach Up, Reach Right, Folded and S-Curve presets, and enable the joint-angle arcs or the dashed reachability circle. Live stats report iterations, tip distance and total reach.
FABRIK was published by Andreas Aristidou and Joan Lasenby in 2011. Unlike many solvers it uses no rotational matrices or trigonometry at all — it works purely by finding points on lines, which makes it fast, stable and easy to extend with constraints, so it is widely used in games and character animation.
Inverse kinematics is the problem of finding the joint angles that place the end of a linked chain — such as a robot arm or a character's hand — at a desired target position. It is the reverse of forward kinematics, where you already know the angles and simply compute where the tip ends up. Here the simulation solves it in two dimensions for an arm of up to six segments.
FABRIK is geometric: it slides joints along straight lines, doing a forward pass that pins the tip to the target and a backward pass that re-pins the root, keeping every segment its exact length. CCD is angular: working from the tip back to the base, it rotates each joint so its remaining sub-chain points more directly at the target. FABRIK usually converges in fewer iterations and produces smoother poses.
The Segments slider chooses how many links the arm has (2 to 6) and Segment length sets each link in pixels (50 to 120). The solver buttons switch between FABRIK and CCD, and the four presets snap the target to common poses. Checkboxes overlay the joint-angle arcs and the dashed reachability circle that marks the maximum reach, which equals segments times segment length.
If the target lies beyond the reachability circle — farther than the total arm length — the chain cannot touch it. In that case the arm fully extends and stretches in a straight line toward the target, leaving a residual gap shown as a non-zero tip distance in the stats panel. Moving the target back inside the circle lets the solver close that gap again.
The geometry of the linkage is accurate: segment lengths are preserved and the solvers are faithful implementations of the published FABRIK and CCD algorithms. However, it is a purely kinematic model, so it ignores dynamics such as mass, motor torque, joint speed limits and collisions. It also leaves joints unconstrained, whereas a real robot would restrict each angle to a mechanical range.
Inverse kinematics (IK) is the computational problem of determining the joint angles of an articulated body (a robotic arm, a character skeleton, or a mechanical linkage) needed to place the end effector at a desired position and orientation. Unlike forward kinematics — which straightforwardly computes end effector position from given joint angles — inverse kinematics is generally non-linear and may have zero, one, or infinitely many solutions.
Common IK algorithms include analytical solutions (for simple geometries), the Jacobian pseudoinverse method (which iteratively moves joints in the direction that reduces the error between current and target positions using the gradient of the forward kinematics), and FABRIK (Forward And Backward Reaching Inverse Kinematics), a geometric iterative method that is fast and stable for articulated chains. CCD (Cyclic Coordinate Descent) adjusts one joint at a time to minimise the residual error.
Inverse kinematics is foundational to robotics (industrial robot arms, walking machines, surgical robots), character animation (allowing animators to position hands and feet naturally while the software computes the elbow and knee angles automatically), motion capture post-processing, and prosthetic limb control. Modern deep-learning approaches train neural networks to predict joint angles directly from desired end effector states, enabling real-time IK for complex kinematic trees.
Forward kinematics computes the end effector position from a given set of joint angles — a direct calculation using transformation matrices. Inverse kinematics solves the reverse problem: given a desired end effector position, find the joint angles. FK has a unique solution; IK may have many, one, or no solutions.
A redundant kinematic chain (more degrees of freedom than required to reach the goal) has infinitely many joint configurations that place the end effector at the same position. Even non-redundant arms often have two solutions (elbow up/elbow down). Algorithms select among solutions using additional criteria like minimising joint movement or avoiding obstacles.
The Jacobian is a matrix of partial derivatives relating small changes in joint angles to small changes in end effector position and orientation. The pseudoinverse of the Jacobian maps desired end effector velocities back to joint velocities, enabling iterative IK solvers that move joints incrementally toward the goal.
FABRIK (Forward And Backward Reaching Inverse Kinematics) is a geometric IK algorithm that alternates between reaching forward from the root to the target and backward from the target to the root, adjusting each joint's position along the bone direction. It is simple to implement, fast, stable, and handles joint limits well, making it popular in games and real-time applications.
Animators specify the desired position of the character's hand or foot (the end effector), and the IK solver computes elbow, shoulder, knee, and hip angles automatically. This is far more intuitive than setting every joint angle manually for each frame. Procedural IK also allows characters to adapt to terrain in real time, such as placing feet accurately on uneven ground.