Feature Library

A six-axis arm with analytic IK

0.56 GPU · 0.77 CPU ms
A still of the A six-axis arm with analytic IK demo
Still
The live demo starts when it’s in view.Drag the target (Shift-drag lifts it) · orbit round the cell · Play pick and place

An industrial robot arm that moves like tonnes of servo-driven steel.

What it costs a frame

0.56 ms
0.77 ms
GPU
0.56 ms
CPU, median
0.77 ms
CPU, 95th pct
1.20 ms
Draw calls
78
Weight
Moderate

Measured 13 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 0.35–0.96, CPU 0.56–0.77 ms). What ran: The pick-and-place loop with a 420 kg block: planned quintic moves, straight lines solved to joints every 1/180 s step, compliance, sag and settle, shadows from one key light and a room environment; the joint panel written a few times a second. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool0.560.771.20
apple · Apple A19 Proin a browser tab · 16 November 20262.110.541.82
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20262.621.632.28

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
three.js r187No other packages

What it’s for

  1. A robot cell on a product or factory page
  2. Teaching inverse kinematics and joint limits
  3. Pick and place, welding or inspection loops in a scene
  4. A machine that points at what you point at
  5. An arm that feels heavy, not floaty

Pitfalls, in brief

  1. Pass the present joints as ref to every solve: an angle and the same angle plus a turn are the same pose, and without ref J1, J4 and J6 can flip a whole turn between steps. near() picks the turn closest to ref.
  2. A wrist straight in line (J5 near 0) is a singularity: J4 and J6 then turn the same axis, and any split is a solution.
  3. Points past a joint limit or the reach are not refused: the joints are clamped and the reach eased in (the tool lands short).
  4. World units are the arm’s: reach 334 is its drawn size, and the whole arm is scaled for another reach.
  5. step(dt) runs fixed 1/180 s sub-steps: call it with the frame’s real dt (capped, say 50 ms) and the motion is the same at any frame rate.
4 more in brief
  1. A move’s promise resolves only once the ringing has died (settle) unless settle: false; chain a lift with settle: false and the next move starts while the last still brakes, which is how corners are flown through.
  2. Set the load (attach(obj, mass)) before moving off with it: load scales the slowing, the sag and the ringing, and a heavy load changing mid-move kicks the compliance.
  3. The arm is never quite still while the servos hunt; hunt (default 4 s) stops that after it comes to rest, and alive tells you when it has.
  4. The geometry is built once and shared by every arm on the page: dispose each arm, and call disposeArmGeometry() after the last one (a scene-wide dispose frees it too, and the next arm builds it again).
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Donald L. Pieper, The kinematics of manipulators under computer control (Stanford, 1968): Why a six-axis arm with a spherical wrist has a closed-form solution: position from the first three joints, orientation from the last three.

Tamar Flash & Neville Hogan, The coordination of arm movements (Journal of Neuroscience, 1985): The minimum-jerk quintic (10s³ − 15s⁴ + 6s⁵) every planned move follows.

A. M. Andrew, Another efficient algorithm for convex hulls in two dimensions (1979): The monotone-chain hull that outlines each cast link.

Numerical Recipes (Press et al.): The LCG constants (1664525, 1013904223) behind the servos’ hunting and the arc’s flicker.

inverse kinematicsanalytic ikclosed formrobot armsix axisspherical wristjoint limitsmotion planningquinticcompliancepick and placeprocedural modelthree.jswebgpurests when idle

Near it in the frame