Visualizations
259 / 500

259 · Physics

Radiating Charge

Shake an electric charge and watch light peel off its field lines at c.

The charge's path is recorded at 120 Hz, and every point on screen feels it as it was at the retarded time, when a signal leaving the charge at the speed of light would just arrive. A binary search through the history finds that moment for each cell of a small grid, and the exact Lienard-Wiechert solution gives the field there: the 1/R^2 velocity part glows faintly blue around the charge, while the 1/R radiation part, painted warm or cool by its sign, is the light that escapes. Field lines are chains of light signals sent out at a fixed angle in the charge's rest frame and aberrated by its velocity, so every jolt puts a kink in them that races outward at exactly c. An antenna broadcasts ripples, a sudden stop emits a bremsstrahlung shell, and an orbit at 0.78c winds the field into synchrotron spirals.

Try it. Press and drag anywhere to pull the charge around, then let go to stop it. Pick Antenna, Brake, Synchrotron or Drag from the chips or keys 1 to 4, press Q to flip the charge's sign, and Space for a sudden kick.

  • Lienard-Wiechert fields
  • Retarded-time binary search
  • Relativistic aberration
  • Adaptive per-pixel rendering

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build an interactive picture of an electric charge's field lines that kink and ripple outward at the speed of light when the charge moves, using JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a full-window canvas that stays sharp on high-DPI screens and resizes with the window. Paint it a deep navy.
- Pick a speed of light c of about a third of the screen width per second, and keep the charge below 0.9c.
- Let the charge follow the mouse with a spring, capped below c. Record its position and velocity every 1/120 of a second in a ring buffer covering a few seconds of history.
- Draw about 24 field lines with the light-signal construction: line k is the chain of points where signals sent out at angle k at every past moment have reached by now. Point j sits at position[j] + c * age[j] * direction. Connect the points in order.
- For a moving charge, aberrate each direction by the velocity at that moment (parallel part (cos + beta) / (1 + beta cos), perpendicular part sqrt(1 - beta^2) times the sine over the same denominator).

Once that works, make it beautiful:
- Shade the background with the radiation field. For each cell of a coarse grid, binary search the history for the retarded time, when |x - r(t_r)| = c (t - t_r), and evaluate the 1/R acceleration term of the Lienard-Wiechert field. Color its sign warm and cool so the outgoing shells glow.
- Add buttons for an oscillating antenna, a sudden stop and a circular orbit at 0.8c.
- Bridge sharp kinks with arcs rather than straight chords.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as two charges interfering, a magnetic field view, or sound from the radiated field.
PreviousZen GardenRaked gravel in low morning sun, its furrows flowing around mossy stones. NextOscilloscope MusicA phosphor XY scope draws a 4D tesseract, knots and text from the stereo sound you hear.

Related visualizations

  • Near Light SpeedPhysics Drive a city street near light speed and see what relativity really does to the view.
  • Magnetic BottlePhysics Particles gyrate, bounce and drift in Earth's dipole, filling the radiation belts.
  • Iron FilingsPhysics Magnets on paper dusted with iron filings, drawn by line integral convolution.
  • Bubble ChamberPhysics Archival film of particle tracks: tightening spirals, V decays and pairs.
  • Op ArtGenerative art Riley and Vasarely style compositions that ripple, bulge and vibrate.
  • Faraday WavesFluids A shaken dish of liquid locks into stripes, squares, hexagons and a 12-fold quasicrystal.
  • AuroraNature Curtains of oxygen and nitrogen light on tilted field lines, mirrored in a lake.
  • Light & ShadowPhysics Red, green and blue lights cast crisp, colored shadows through spinning shapes.
  • Phased ArrayPhysics Steer and focus a beam of sound with per-speaker delays in a live 2D wave simulation.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs