paused — dragging pivot
100%
Pendulums
Shape & Motion
Angle 1 90°
Angle 2 120°
Length 1 1.0
Length 2 1.0
Mass 1 1.0
Mass 2 1.0
Opacity 0.80
Thickness 1.5
Trail Color
Simulation
Gravity 9.8
Speed 1.0×
Damping 0.000
Fade
Blend
Erase
time0.0s
steps0
count0
zoom1.00×

Documentation

Double Pendulum Art — reference guide

Quick start

Open the Studio tab. Two pendulums start running immediately. You don't need to do anything — the trails draw themselves. Give it 30 seconds before adjusting anything.

Select a pendulum by clicking its name in the Pendulums list. The selected one is outlined in white on the canvas. All the Shape & Motion controls apply to the selected pendulum only.

Hit Clear to wipe trails and start fresh. Hit Save image when you're happy.

Tip Start two pendulums with Angle 2 just 1° apart. They'll look identical for a few seconds, then chaos kicks in and they diverge completely.

Toolbar

CommandDescription
Pause / Play Freeze or resume the simulation. Trails stay on screen; only new drawing stops.
Clear Wipe all trails and reset the timer. Pendulums keep their current position and settings.
Reset all Remove all pendulums and restore defaults. Shows a confirmation dialog first.
Move pivot Toggle pivot drag mode. When on, drag a pendulum's anchor dot to reposition it. Simulation pauses during drag and resumes on release.
Hide / Show rods Toggle the arm lines connecting pivot to balls.
Hide / Show balls Toggle the circular bob indicators at the end of each arm.
Share Generate a URL encoding all current settings. Opening it loads the exact same configuration.
Publish Save a thumbnail to the shared gallery. 24-hour cooldown between publishes.
Save image Download the canvas as a full-resolution PNG. Choose trails only or include rods and balls.

Pendulums

Multiple pendulums run simultaneously through the same physics. Each draws its own trail in its own color. Click a name to select it. Click × to delete it and clear its trail. + add pendulum creates a new one.

Note Simulation settings (gravity, speed, damping, fade) affect all pendulums. Shape & Motion settings affect only the selected one.

Shape & motion

Applies to the selected pendulum only. Changing either angle resets that pendulum's velocity to zero and starts it from the new position.

ParameterDescription
Angle 1
per pendulum
Starting angle of the upper arm in degrees from vertical. 0° = straight down, 90° = right, 180° = straight up.
Angle 2
per pendulum
Starting angle of the lower arm. Small differences in this value between pendulums cause large divergence in the resulting trails.
Length 1
per pendulum
Upper arm length as a multiple of the base scale. Longer = lower arm swings in a wider orbit.
Length 2
per pendulum
Lower arm length. Longer = wider, more dramatic trails. Shorter = tight spirals.
Mass 1
per pendulum
Upper bob mass. Heavier upper bob makes the top arm dominate; lower arm follows more passively.
Mass 2
per pendulum
Lower bob mass. Heavier lower bob increases chaos and spreads the trail further.
Opacity
per pendulum
Transparency of each trail segment. Lower = subtle overlap blending. Higher = every stroke fully visible.
Thickness
per pendulum
Width in pixels of each trail segment.

Simulation

These settings apply globally to all pendulums.

ParameterDescription
Gravity
global
Gravitational constant. Higher = faster swinging. Earth real-world value is 9.8.
Speed
global
Simulation time multiplier. At 2× the pendulum moves twice as fast; physics stay accurate. Use 3–4× to fill the canvas quickly.
Damping
global
Energy loss per step, like air resistance. 0 = swings forever. Increase to make pendulums spiral inward and come to rest.
Fade
global
Controls how quickly old trail segments disappear. Off = trails stay forever. Faster fade = comet-tail effect where only the recent path is visible.
Blend
global
additive — overlapping areas glow brighter (best for dark backgrounds). normal — paints on top. multiply — overlaps get darker (use on light backgrounds). screen / overlay — mid-range effects.
Known issue Very high gravity combined with very high speed can cause the integrator to produce invalid positions (visible as long straight lines shooting across the canvas). If this happens, reduce speed or gravity, then hit Clear.

Color

Click any swatch to apply that color to the selected pendulum's trail. Use the color picker or type a hex code directly to set a custom color. The trail updates immediately.

Erase trails

Check one or more pendulums, then click Erase to remove just those trails without stopping the simulation or deleting the pendulum. Use All / None to select everything or clear the selection.

Zoom & pan

InputAction
Scroll wheelZoom in/out centered on the cursor.
Click + dragPan the canvas.
+ / − buttonsZoom controls in the bottom-left corner.
⌂ buttonReset to 100% zoom and center the view.

The simulation keeps running while you navigate. Trails are drawn in canvas space, not screen space — zooming reveals detail without affecting physics.

Moving pivots

Enable Move pivot in the toolbar. Each pendulum's anchor point becomes draggable. The simulation pauses while you drag and resumes on release. Drag pivots to different areas of the canvas to create intersecting compositions.

Tip Pivot positions are saved in Share URLs and Publish snapshots.

Saving & sharing

ActionOutput
Save imageFull-resolution PNG download. Choose Art only (trails only) or With pendulum (includes rods and balls).
ShareURL encoding all pendulum settings. Sharing it loads the exact same starting configuration.
PublishSaves a 480×300 JPEG thumbnail to the shared gallery with a title and optional author name.

Double Pendulum Art

A generative art tool running entirely in your browser. The second bob's trail is the painting — no randomness, no noise, no tricks. Just a differential equation integrated forward until something beautiful happens.

How it works

A double pendulum has two rigid arms connected end to end, hanging from a fixed pivot. The full state at any moment is four numbers:

Every frame, the second bob's position is computed and a line is drawn from where it was to where it is now.

Equations of motion

The equations come from the Lagrangian — L = T − V, kinetic minus potential energy.

Angular accelerations

denom = 2*m1 + m2 - m2*cos(2*θ1 - 2*θ2)

α1 = [ -g*(2*m1+m2)*sin(θ1) - m2*g*sin(θ1-2*θ2)
       - 2*sin(θ1-θ2)*m2*(ω2²*L2 + ω1²*L1*cos(θ1-θ2)) ]
     / (L1 * denom)

α2 = [ 2*sin(θ1-θ2)*(ω1²*L1*(m1+m2)
       + g*(m1+m2)*cos(θ1) + ω2²*L2*m2*cos(θ1-θ2)) ]
     / (L2 * (L2/L1) * denom)

Integration

4th-order Runge-Kutta (RK4), 8 substeps per rendered frame. Each substep checks for NaN/Infinity in the result and clamps velocities to prevent integration blow-up at extreme parameter combinations.

Chaos and sensitivity

Same initial conditions always produce the same trail. Change the starting angle by 0.001° and within seconds the two runs look completely different.

Rendering

Two canvas layers: the trail canvas is persistent (cleared only on Clear), and the pendulum canvas redraws every frame. Each pendulum also writes to its own offscreen canvas, enabling selective per-pendulum trail erasure.

Everything runs locally in your browser. The gallery uses shared storage so posts are visible to other users — hence the 24-hour publish cooldown.