Sine and cosine turn an angle into a smooth back-and-forth, which is all you need for waves, springs and swinging pendulums. Combine several oscillations and you get the looping drawings of a harmonograph, coupled oscillators with their normal modes, wobbling jelly soft bodies, or — with a Fourier series — any shape at all built from circles turning inside circles.

The double pendulum shows how simple rules create unpredictable behaviour: start two copies a hair’s breadth apart and watch them diverge.

Every simulation below runs right here in your browser, for free, with live controls. Open one, change the sliders, and use the mouse — most of them respond to it.

Oscillation simulations

Pendulum Wave

Pendulum Wave — interactive simulation

A pendulum is angular motion driven by gravity: α = −(g / L)·sin(θ). Longer pendulums swing more slowly.

Here every pendulum hangs from the same pivot, and the lengths are chosen so their frequencies form the series 20, 21, 22, … swings per cycle. Moving in and out of phase, they draw snakes, waves and moments of apparent chaos before lining up again.

Try this: Grab any bob with the mouse and throw it. Set "Pendulums" to 1 for a classic single pendulum.

Open Pendulum Wave →

Springs (Hooke's Law)

Springs (Hooke's Law) — interactive simulation

Hooke's law: a spring pulls with force F = −k·x, where x is how far it is stretched past its rest length. Chain several springs together and you get waves, bouncing and swinging.

Damping removes a little energy every frame. Without it the chain would bounce forever.

Try this: Grab any bob, or the anchor at the top, and drag it around. Raise the mass to see slower, heavier bouncing.

Open Springs (Hooke's Law) →

Oscillation & Waves

Oscillation & Waves — interactive simulation

Simple harmonic motion follows a sine: y = A·sin(2π·x / λ + φ). Amplitude A sets the height, wavelength λ sets the spacing, and advancing the phase φ each frame makes the wave travel.

Adding two waves (superposition) produces interference: beats, standing waves and complex shapes. Each bead only moves up and down, yet together they look like a moving wave.

Try this: Give both waves the same wavelength and opposite speeds to make a standing wave.

Open Oscillation & Waves →

Double Pendulum & Chaos

Double Pendulum & Chaos — interactive simulation
Generation 2: an evolution of Pendulum Wave

Hang a pendulum from a pendulum and the motion becomes chaotic: fully deterministic, yet impossible to predict over the long run.

This experiment starts many double pendulums whose first angles differ by a tiny amount (10⁻⁶ radians by default). They move as one at first, then the differences grow exponentially and they fan out. This is the butterfly effect. The equations of motion come from Lagrangian mechanics and are integrated with 4th-order Runge–Kutta.

Try this: Set the perturbation to −9 (10⁻⁹) and count how much longer they stay together.

Open Double Pendulum & Chaos →

Pressure Soft Bodies (Jelly)

Pressure Soft Bodies (Jelly) — interactive simulation
Generation 2: an evolution of Springs (Hooke's Law)

A soft body is a ring of point masses joined by springs, with a twist: the gas inside pushes outward. Each frame the enclosed area is computed (shoelace formula), and every edge is pushed along its outward normal with a force proportional to A₀ / A. Squashing a blob raises its "pressure", so it bulges back.

Blobs also collide: any point that ends up inside another blob is pushed back to its surface.

Try this: Grab a blob and throw it at the others. Then set pressure to 0 and they collapse like deflated balloons.

Open Pressure Soft Bodies (Jelly) →

Fourier Epicycles

Fourier Epicycles — interactive simulation
Generation 2: an evolution of Oscillation & Waves

The previous demo added two sine waves. Fourier showed that any periodic signal is a sum of sines. In 2D that means any closed drawing can be traced by a chain of rotating circles (epicycles), each spinning at a whole-number frequency.

The Discrete Fourier Transform turns the shape's points into circle radii and starting angles. Circles are sorted biggest first, so a handful already capture the rough shape and the rest add fine detail.

Try this: Pick "Draw your own", sketch a shape with the mouse, then lower the number of circles to 3, 5, 10…

Open Fourier Epicycles →

Harmonograph

Harmonograph — interactive simulation
Generation 2: an evolution of Pendulum Wave

A Victorian drawing machine. One pendulum moves the pen left–right, another moves it up–down (each is really two pendulums added together). Every motion is a damped sine: A·sin(f·t + φ)·e^(−d·t).

When the frequencies are close to simple ratios like 2:3, the pen traces Lissajous figures. Tiny detuning makes the figure slowly rotate, and damping spirals it inward, drawing those intricate woven patterns.

Try this: Press "Random design" a few times, then nudge one frequency by 0.01 and redraw.

Open Harmonograph →

Coupled Oscillators & Normal Modes

Coupled Oscillators & Normal Modes — interactive simulation
Generation 2: an evolution of Springs (Hooke's Law)

Connect a row of masses with springs between two walls. Pluck one and the motion looks messy, but it is secretly a sum of normal modes: special patterns in which every mass oscillates at the same frequency. Mode n looks like a standing sine wave with n humps, and higher modes vibrate faster.

The bars show how much of each mode is present. Excite a pure mode and its bar stays alone forever. This is exactly how a guitar string's harmonics work, and how physicists describe crystal vibrations (phonons).

Try this: Excite mode 1, then drag one mass and release it. Watch energy appear in many bars at once.

Open Coupled Oscillators & Normal Modes →

Ripple Tank (2D Wave Equation)

Ripple Tank (2D Wave Equation) — interactive simulation
Generation 2: an evolution of Oscillation & Waves

The 1D waves earlier were drawn from a formula. Here they emerge from a rule applied to every cell of a grid, the wave equation: each cell accelerates toward the average of its neighbours, u_next = 2u − u_prev + c²·∇²u.

Ripples spread, reflect off walls, and interfere. In the double-slit scene, a plane wave passing through two gaps makes the bands of constructive and destructive interference that once proved light is a wave.

Try this: Choose "Double slit" and look at the fan of bright and dark bands. Click anywhere to drop a stone.

Open Ripple Tank (2D Wave Equation) →

Phase Space & Strange Attractors

Phase Space & Strange Attractors — interactive simulation
Generation 3: an evolution of Double Pendulum & Chaos

Plot a pendulum not in space but in phase space: angle θ horizontally, angular velocity ω vertically. Each point is a complete state, and the motion becomes a path. A free pendulum traces closed loops (swinging) or wavy lines (spinning over the top), and damping makes them spiral into the rest point.

Add a periodic push (a driven, damped pendulum) and at some settings the motion becomes chaotic. The Poincaré section samples the state once per push. Chaos then shows up as a fractal pattern: a strange attractor.

Try this: Press "Chaotic regime", then switch the view to "Poincaré section" and let it build up.

Open Phase Space & Strange Attractors →

Soft-Body Lattices

Soft-Body Lattices — interactive simulation
Generation 3: an evolution of Pressure Soft Bodies (Jelly)

The jelly blobs were hollow rings held up by pressure. A different approach fills the body with a lattice: a grid of point masses with structural springs along the rows and columns, plus shear springs along the diagonals so the squares can't simply fold flat.

Stiffness comes from how many times per frame the spring constraints are solved. Few iterations give wobbly pudding, many give firm rubber. Points from different bodies push each other apart, so the blocks can stack and squash.

Try this: Drag a block and drop it on the others. Then lower the iterations and drop it again.

Open Soft-Body Lattices →

Fourier Series: Building Waves

Fourier Series: Building Waves — interactive simulation
Generation 3: an evolution of Fourier Epicycles

The 1D version of epicycles. A square wave is the sum of odd harmonics (4/π)·[sin t + sin 3t/3 + sin 5t/5 + …]. Each harmonic is a rotating arrow (phasor), and chaining them traces the wave on the right.

Adding terms sharpens the corners, but the overshoot next to each jump never disappears. It stays about 9% high no matter how many terms you add. This is the Gibbs phenomenon.

Try this: Compare the triangle wave (its harmonics shrink like 1/n², so it converges fast) with the square wave (1/n).

Open Fourier Series: Building Waves →

Evolve them into something new

Several of these are already evolutions: Double Pendulum & Chaos grew out of Pendulum Wave; Pressure Soft Bodies (Jelly) grew out of Springs (Hooke's Law); Fourier Epicycles grew out of Oscillation & Waves; Harmonograph grew out of Pendulum Wave. In Labs you can take any of them a generation further: press Evolve this, get suggestions for what the next version could add, and build the one you like — or combine two or three simulations into one system.

Make your own simulation →
Pick oscillation as a concept, choose an art piece, game, explainer or experiment, and Labs suggests ideas and builds the one you choose.

Open Labs →

More from Labs