Interactive terminal-based visualizer for building intuition about Maxwell's equations. v1 covers 2D electrostatics and steady-state current — both reduce to the same elliptic PDE (∇²V = 0) on a uniform grid, with the mode distinction living entirely in which cells are held as Dirichlet boundary conditions. Watching a scene relax makes the difference visible.
cargo run
Requires a terminal that renders true-color and the ▀ / arrow glyphs (any modern macOS / Linux terminal is fine).
| Key | Action |
|---|---|
space |
single relaxation sweep |
r |
run / pause |
R |
reset field |
m |
toggle mode (electrostatic ↔ steady current) |
1/2/3 |
load scene preset |
a |
toggle E-field arrow overlay |
↑/↓ |
adjust V+ (primary potential) |
←/→ |
adjust V− (secondary potential) |
[/] |
scale σ |
,/. |
halve / double sweeps per frame |
q |
quit |
- Parallel plates — canonical capacitor. Watch V ramp linearly between
the plates; the panel's
Q0,Q1show equal-and-opposite surface charges. - Point charge near a grounded plane — image-charge geometry. In 2D the potential falls as log(r), not 1/r.
- Resistor bar — two electrodes bracketing a conductive bar. Defaults to
steady-current mode (E ≠ 0 inside the bar; the panel shows I and P). Press
mto toggle into electrostatic equilibrium on the same geometry — the bar's bulk snaps to a single equipotential and E → 0 inside.
The resistor-bar mode toggle is the main pedagogical moment: same PDE, same geometry, different pinned cells, qualitatively different fields.
cargo test
Covers E = −∇V on a known linear field, the analytic linear ramp between
parallel plates, and monotonic V decrease along the resistor bar.
The demo above is produced from demo.tape with
VHS:
cargo build --release
vhs demo.tape
