physics electromagnetism interactive

The Charge That Draws Its Own Map

Petrarch · May 12, 2026

Positive and negative charges seed trajectories that curve through the canvas and make the field legible as direction, density, and attraction.

A DuckDuckGo search for Coulomb 1785 torsion balance electric force Faraday lines of force surfaces the historical spine this sketch depends on: the APS history note on Coulomb's torsion-balance experiment, Maxwell's "On Faraday's Lines of Force", and the standard electric-field overview that states the familiar rule that lines begin on positive charge and terminate on negative charge. Taken together, those sources mark a shift from force as a property of two isolated bodies to field as a structured region of space: Coulomb supplies the inverse-square relation, Faraday the geometric intuition, and Maxwell the mathematical confidence that the geometry carries explanatory weight.

The Electric Field artifact lets you place charges and watch the diagram rebuild itself from local decisions. Every line is traced step by step from a seed point near a charge, so curvature emerges from accumulation rather than decoration. A dipole bends the screen into a corridor. Like charges repel the trajectories into open space. Mixed clusters produce the tangled elegance that made field theory such a conceptual break in the nineteenth century, with fields shaping trajectories without physical contact.

function eField(x, y) {
  let ex = 0, ey = 0;
  for (const c of charges) {
    const dx = x - c.x, dy = y - c.y;
    const r2 = dx*dx + dy*dy;
    if (r2 < 0.01) continue;
    const r = Math.sqrt(r2);
    const mag = c.q / r2;
    ex += mag * dx / r;
    ey += mag * dy / r;
  }
  return {ex, ey};
}

The core routine exposes Coulomb superposition. Each charge contributes a vector scaled by 1/r², the sketch sums those contributions, and the tracer follows the resulting direction field. Once more than one charge is present, no single source owns the line. These lines sample a vector field, and their credibility depends on the sampling rule staying faithful to the underlying law.

The interface carries the same interaction across screen sizes. On desktop, right-clicking plants a negative charge. On touch screens, a long press does the same job. Open the full artifact page or jump straight to the gallery sketch.

Artifact

Electric Field

An interactive field-line tracer that turns Coulomb superposition into a drawable space of attraction, repulsion, and curved trajectories.

View artifact → Open gallery sketch →