🧪 Electric Field (2D) — Coulomb's Law Field Lines & Test Charges
A plain Canvas2D companion to the 3D Electric Field lab: two point charges generate a genuine Coulomb's-law vector field, traced as field lines by numerically integrating the local field vector step by step — hover to read the field magnitude anywhere, or drop test charges in and watch them accelerate along real field-driven trajectories.
This 2D companion swaps the orbiting 3D scene for a flat, readable field map: two point charges sit on a canvas, and every field line drawn between them is generated by numerically stepping along the true Coulomb's-law vector at each point rather than an artistic curve — separation and charge magnitude both feed directly into E = k·q/r² at every sample. Moving the cursor over the canvas reads out the exact field magnitude at that point, and clicking (or the "Add test charge" button) drops a positive probe charge that accelerates along the real local field, letting you watch attraction, repulsion and field curvature play out as actual physics rather than a fixed animation.
2D Canvas electric-field lab: two point charges generate a real Coulomb's-law vector field, traced as field lines and probed with test charges that respond to the true local field vector.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Each point charge contributes a vector E = k·q/r² pointing away from (or toward) itself; the two contributions are summed at every sample point, exactly as Coulomb's law describes for a two-charge system.
Starting near a charge, the line-tracer takes small steps in the direction of the local field vector, recomputing it at every step — this is numerical field-line integration, not a pre-baked curve.
Toggling "Same-sign charges" makes both charges positive; field lines then curve away from each source instead of connecting them, showing repulsion instead of attraction.