Fourier Series ↔ Robot Arms

A chain of spinning links is a complex Fourier series in disguise. Drag the arm, drag the spectrum, draw your own shape — watch the two views of the same math move together.

In gesture mode (the default), the arm+hand is a joint-angle TREE: dragging any joint (main or finger) rotates that joint's mean angle only — the oscillation continues around the new mean, and everything downstream follows. In Fourier-spin mode, each link is one Fourier component — length = amplitude, spin rate = frequency, starting angle = phase — and plain-dragging a joint rotates that bone only (shift-drag also changes its length; on bare, non-anatomical links, dragging sets both length and angle at once). The fading trail is the end-effector path.

Power/amplitude spectrum: one stem per frequency. Drag ↑/↓ for amplitude, ←/→ for frequency; alt-drag, the phase ring, or the mouse wheel (while a stem is selected and the pointer is over its head) for phase; double-click empty space to add a component; select a stem and press Delete/Backspace to remove it; shift-drop one stem onto another to merge them into one.

Joints

Each row is one joint's periodic angle q(t) = q̄ + ∑ ahcos(2πht + ψh): the mean q̄ (set by dragging the joint) plus a few harmonics. Fingers are grouped into collapsible sections. Selected row is highlighted; edits here, on the arm, or on the spectrum all stay in sync.

Draw a closed shape

Just draw on the canvas (or use the preloaded example). The stroke is resampled, DFT'd, and reconstructed epicycle-by-epicycle — 3Blue1Brown style — from the top-K components.

RMS error—

K controls how many frequencies are kept. Low K = smooth approximation; high K = near-exact reconstruction of the drawing.

The filtered arm: the same motion as the Arm tab, rebuilt from only what survives the bandwidth limit (and, when enabled, the actuator-lag filter) below. For a gesture, each joint keeps only its angle harmonics with h ≤ B, so the wave shrinks and a pick-up can miss the ball; for the Fourier-spin arm, each link is a constant-velocity actuator and only links with |f| ≤ B survive. This view is not interactive; go to the Arm tab to drag joints or spectrum stems.

Top: joint angle over one period (absolute θk(t) or relative qk(t), wrapped or unwrapped per the controls above). Bottom: signal spectrum |cf| (light bars) with the filtered spectrum (solid bars) and the filter's magnitude response |H(f)| (line) overlaid — the band-limit box, the actuator-lag curve, or both.

Bandwidth & tracking
Energy captured—
Tracking error—

Truncating to |f| ≤ B is a hard low-pass filter on actuator bandwidth: only components inside the passband survive, so the tip can only track band-limited paths. The bandwidth limit always applies; switching on actuator lag additionally applies a smooth first-order filter H(f) = 1/(1 + i f/fc) on top of it, shrinking and phase-delaying every surviving component — a more realistic actuator model.