An equipotential is a set of locations with the same scalar electric potential. It is not a force line or a physical wall. In a two-dimensional display it appears as a contour; in three dimensions it is a surface. The useful programming claim is local: a small move tangent to an exact equipotential changes potential by zero, while the electrostatic field points in the direction of greatest decrease.
The tangent displacement dℓ lies along the contour. Since dV is zero there, ∇V is perpendicular to the tangent; E = −∇V has the same normal line with opposite sign. In code, normalize only after checking that both vectors have nonzero magnitude. A near-zero sampled gradient means the angle is ill-conditioned, not necessarily that the physics rule failed.
For a positive point charge, V = kq/r gives nested circular contours in an ideal two-dimensional slice. Farther contours correspond to lower potential. A symmetric pair of opposite charges is a stronger test: the perpendicular-bisector line has zero potential under equal-and-opposite source assumptions, while its field is generally not zero. This prevents the mistaken rule “zero potential means zero field.” Potential has an arbitrary additive reference; only differences and gradients carry the usual electrostatic predictions.
Contour extraction is a data pipeline. Each grid cell supplies corner values. A contour level crosses an edge only when the values bracket that level according to a documented equality rule; linear interpolation estimates the crossing location. Ambiguous cells, exactly-on-level vertices, and field singularities need deterministic tie-breaking so equivalent runs produce the same segments. The output should preserve the contour level with every segment rather than infer it later from color.
Prediction: At a regular contour point, the field has no tangent component; shifting every potential sample by the same constant changes no field direction.
Choose an analytic potential such asV(x,y) = x² + 2y². Extract a level near the point (1, 1), estimate a tangent from nearby vertices, and compute E · tangent. Halve the grid and finite-difference steps separately, then report which residual changes. Finally add +7 V to every sample and check that field samples remain unchanged.Generate equipotentials as labelled level-set geometry from scalar data, then verify both the requested potential value and the local field-normal relationship. Preserve grid, interpolation, and singularity choices with the result.
E · tangent ≈ 0 test?Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.
\[\text{observable output} = f(\text{inputs},\,\text{state})\]For Equipotential Surfaces, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Electric Potential and Capacitance, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.
Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.
This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.
Treat Equipotential Surfaces as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.
Generate and validate equal-potential contours from sampled scalar-field data.