⚡ 2D Electric Field Simulator — Field Lines & Equipotentials
Interactive 2D electric field visualization. Place positive and negative point charges, trace real Coulomb's-law field lines and equipotential contours, and drag a test charge along the true local force.
A flat electrostatics sandbox: place positive and negative point charges anywhere on the plane and watch the real field they create, drawn two ways at once — orange field lines showing force direction, and pale equipotential contours showing where the potential is constant. Drop in a test charge and it accelerates along the true local force, not a scripted path.
🔬 What It Demonstrates
Every charge contributes E = k·q·r̂/r² to the total field (Coulomb's law + superposition). Field lines are traced by streamline integration — following the actual computed field direction step by step. Equipotential contours come from marching squares over V = Σ k·q/r sampled on a grid, and are always perpendicular to the field lines, exactly as the theory predicts.
🎮 How to Use
Pick + or − and click empty space to add a charge. Click a charge to select it, then drag to move, press F to flip its sign, or Delete to remove it. Turn on Test Charge to drop a yellow particle that genuinely accelerates along the local field — drag it to a new starting point and release to watch it move under the real force.
💡 Did You Know?
Field lines and equipotential lines are always mutually perpendicular because the field is the negative gradient of the potential — motion along an equipotential does no work on a charge, so the force (and the field line) can never point along it. This 2D view makes that geometric relationship far easier to see than the full 3D picture.
About the 2D Electric Field Simulator
This simulation computes the electric field of one or more point charges confined to a flat plane. Each charge contributes a field given by Coulomb's law, E = kq/r², and the total field at any location is the vector sum of every charge's contribution — the principle of superposition. The simulator renders that field two complementary ways: bright field lines that follow the direction of the force on a positive test charge, and pale equipotential contours that connect points of equal electric potential.
Because the electric field is the negative gradient of the potential, field lines and equipotential contours must always cross at right angles. Seeing both families drawn simultaneously — something that is easy in a flat 2D view and visually noisy in 3D — makes that relationship immediate and intuitive, and it is exactly the technique physicists used to sketch fields by hand before computers could do it numerically.
Frequently Asked Questions
How is this different from the 3D Electric Field Lines simulation?
The 3D version renders field lines and arrows in a rotatable volume around point charges positioned in space. This 2D version confines everything to a flat plane and adds two things the 3D view does not: explicit equipotential contour lines computed by marching squares, and a draggable test charge that is a real point mass accelerating under F = qE, so you can watch it genuinely move through the field rather than only see the field's static shape.
What do the pale contour lines mean?
Each pale line is an equipotential — every point on it has the same electric potential V = Σ kq/r. No work is done moving a charge along an equipotential, which is why these lines are always perpendicular to the orange field lines: the force (and therefore the field line direction) can only point "downhill" in potential, never sideways along a line of constant potential.
How does the test charge move, exactly?
At every animation frame the simulator samples the true local field E at the test charge's current position, computes the force F = qE and acceleration a = F/m, and integrates the charge's velocity and position forward in time. It is not following a pre-drawn field line — release it near two charges and it will genuinely accelerate, overshoot, and can even swing into an orbit-like path if the geometry allows, exactly as real electrostatics predicts.
What is Coulomb's law and how is it used here?
Coulomb's law states that the force between two point charges is F = k·q1·q2/r², where k is Coulomb's constant, q1 and q2 are the charge magnitudes, and r is the separation. The simulator uses a scaled k suited to pixel-space units and evaluates E = k·q·r̂/r² from every charge at every sample point, summing the contributions to get the total field used for both the field lines and the equipotential contours.
Why do the field lines never cross each other?
A field line traces the direction of the net force at each point. If two field lines crossed, the field would have two different directions at that single point simultaneously, which is impossible for a well-defined vector field. This is also why field lines from like charges bend away from each other rather than merging, and why lines terminate only on opposite-sign charges (or run to infinity).
What real phenomena does this kind of field map correspond to?
A 2D cross-section through a long charged wire, the field between the plates of a parallel-plate capacitor near its edges, or the potential map used to design electrostatic lenses in electron microscopes all reduce to essentially this kind of two-dimensional field-and-equipotential picture. Cartographers and physicists used the same idea for contour maps of gravitational or electric potential long before digital simulation existed.
A flat 2D electrostatics sandbox: place positive and negative point charges, trace real Coulomb's-law field lines and equipotential contours computed from the true superposed field, and drag a test charge that genuinely accelerates along the local force.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install