Coulomb’s law defines an inverse-square electric field around an ideal point charge. Multiple sources combine by vector addition. The formula needs two positions, not one: a source position and a physical probe position. Collapsing them to a screen origin or an unsigned distance loses the direction that determines cancellation and force.
Think like a programmer
Implement a strict pure field function per source that accepts probe position, source position, signed charge, coupling/permittivity policy, and units. It must reject the ideal singular source location rather than quietly returning a zero field. Keep any display-safe masking in a separate adapter. Reduce source vectors at a probe using immutable source records, then test symmetry, inverse-square scaling, and field–potential agreement before sending samples to the Three.js renderer.
Model checklist
Inputs
Probe position in metres, source positions and signed charges, electric constant/permittivity policy, source order, singularity exclusion/regularization policy, units, and field-sampling grid.
State
Source-to-probe displacement vectors, per-source field terms, total field vector/magnitude, accepted/rejected probes, and display samples.
Rule
For each source, form R = rprobe − rsource, evaluate the signed inverse-square vector field when R is nonzero, then sum all compatible vectors.
Output
Electric field in N/C or V/m, per-source contribution ledger, symmetry and scaling residuals, singularity warning, and renderer-ready samples.
Check
Positive source field points outward and negative source field inward; doubling isolated-probe distance divides magnitude by four; reversing one charge negates only that term; equal sources cancel at a correct symmetry point; strict calculation rejects a probe on a point source; a finite-difference potential gradient agrees away from sources.
Loading the interactive visual. The lesson text and model remain available while it starts.
At a probe on the positive x axis of a positive source at the origin, the field points +x. A negative source reverses that direction. This basis fixture is more useful than memorizing a diagram because it catches the common source − probe reversal. At twice the radius, magnitude should be one quarter. Test magnitude separately from direction, because an implementation can pass one while failing the other.
Superposition is vector addition. Two equal positive charges have zero field at their midpoint because equal vectors point opposite directions there. Two equal and opposite charges have zero potential at that midpoint, but their fields point in the same direction and add. Use both fixtures: one checks vector cancellation; the other prevents scalar-potential intuition from replacing a field calculation.
The Three.js arrow grid is a view of already calculated samples. Its capped lengths and finite density cannot resolve the unbounded ideal-source point. Show exact selected-probe components and magnitude in text, mark omitted source-near samples, and preserve the source array, grid, scale, and coordinate convention so a reader can reproduce a displayed arrow.
Try this experiment
Prediction: Doubling distance reduces an isolated point field magnitude by four; equal positive sources cancel at their midpoint while equal opposite sources add there.
Write a strict one-source field test at (r,0) and (2r,0). Then add two equal positive sources and test the midpoint vector. Replace one source by its opposite charge and predict the midpoint field. Finally attempt to query the exact source location and state why rejection or a named finite-radius regularization is more honest than a fabricated zero.
Where this model breaks
The point-source formula diverges at the source. Real charge distributions, material response, conductors, moving charges, radiation, relativity, and quantum structure need richer models. A 2D sample is a slice of a 3D field; arrows, color, and clamping are display decisions rather than measurements.
Summary
Model electrostatics as composable strict vector functions, then sample only after testing source/probe direction, inverse-square scaling, superposition symmetry, singularity behavior, and field–potential consistency.
Glossary
Electric field: force per positive unit charge.
Superposition: vector sum of source contributions.
Inverse square: strength proportional to one over radius squared.
Probe: physical location at which a field is evaluated.
Regularization: named finite-scale replacement for an ideal singular formula.
Self-check
What does a strict point-charge field function return?
Why must it receive both source and probe positions?
Which equal-charge configuration cancels field at its midpoint?
Why is a zero vector at an ideal source not a valid physical default?
D. J. Griffiths, Introduction to Electrodynamics, electrostatics.
Model contract
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.
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.
Implement the idea as a model
For Coulomb’s Law as Field Generator, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Electrostatics, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.
Guided experiment
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.
Where this model breaks
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.
Summary
Treat Coulomb’s Law as Field Generator 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.
Glossary
Input: a measured value or chosen parameter supplied to a model.
State: the smallest set of values needed to continue or reproduce a model.
Validation: comparing an output with a known result, limit, invariant, or measurement.
Self-check
Which values are inputs, and which values must remain state?
What observable result would tell you the model is behaving as expected?
Which assumption would you test first before applying the model to a real system?
Model review: turn Coulomb’s Law as Field Generator into a test
Compose point-charge inverse-square field functions and test their vector superposition.
Name the inputs and units that the electrostatics model needs.
Separate the state you must keep from values you can calculate when needed.
Write one rule that maps the current state and inputs to an observable result.
Choose a limiting case, unit check, invariant, or known result before trusting an output.
State one assumption you would change before using this simplified model for a real decision.