Why Opposite Charges Pull and Like Charges Repel: The Physics Behind Every Electric Force
Two charges sitting in empty space. No strings. No contact. Yet they push or pull on each other with measurable, predictable force. Move one charge and the other responds instantly — as if the space between them were not empty at all.
This is what the Charge Interaction visualization lays bare: three scenes — positive-positive, positive-negative, and negative-negative — each with the ability to toggle force vectors, electric field lines, and motion. What it reveals is not just that opposites attract, but why the force follows the precise mathematical form it does, and what that tells us about every charged object in the universe.
Coulomb’s Law: The Same Shape as Gravity, a Different Origin
In 1785, Charles-Augustin de Coulomb published a result that would look familiar to anyone who had studied Newton’s gravitational law:

F = ke · q1 · q2 / r²
The force between two charges is proportional to the product of their magnitudes and inversely proportional to the square of the distance between them. The similarity to gravity is not coincidental — both are inverse-square laws, where the force drops off as the square of the distance. Double the separation, and the force becomes one quarter as strong.
But where gravity only attracts, electricity has a twist. The sign of the product q₁q₂ determines everything:
– Opposite charges (q₁q₂ < 0): force is negative → attraction – Same charges (q₁q₂ > 0): force is positive → repulsion
This sign dependence is why matter at human scale mostly appears neutral. Atoms have equal numbers of positive protons and negative electrons. The macroscopic forces we feel — friction, tension, the spring in your chair — are residual effects from the subtle imbalances between these charges.
The Three Scenes: What Each Configuration Shows
Positive–Positive: Repulsion in Real Time
Two positively charged particles pushed apart. The visualization lets you watch the force vectors (red arrows) point away from each charge at every instant. Toggle enableMotion and the charges drift further apart, accelerating as distance grows and the force weakens.

The key insight: the force vector on each charge always points directly along the line joining the two charges. There is no sideways deflection, no obliqueness — only a pure radial push.
Positive–Negative: Attraction
Flip one charge negative. The force vectors reverse direction instantly. Now both arrows point toward the other charge. The particles begin drifting together, and the visualization shows how the attraction accelerates as the gap shrinks — until they meet or reach an equilibrium distance.
This is the configuration behind ionic bonding in chemistry and the adhesion of dust to a charged surface.
Negative–Negative: Like Repels Like
Two negatives behave exactly like two positives — pure repulsion. This is often counterintuitive to students because we rarely think of “negative matter” pushing away from itself. But the charge’s sign determines the direction of force, not its presence.
Electric Field Lines: Drawing the Invisible
Enable showFieldLines in the visualization and the canvas fills with curved lines emanating from each charge. These are not artistic flourishes — they are a topological map of the electric field.

Every point in space around a charge has a direction and magnitude of field, represented by field lines: – Lines diverge from positive charges (sources) – Lines converge on negative charges (sinks) – Field line density indicates field strength – Field lines never cross — each point has one unique field direction
Field lines are perhaps the most intuitive visualization in electromagnetism because they map something genuinely three-dimensional onto a two-dimensional canvas without losing the directional information that matters.
Force Vectors: Who Pushes Whom
The showForceVectors toggle overlays instantaneous force arrows on each charge. In a two-body system these are equal and opposite — Newton’s third law at work. Each charge experiences the same magnitude of force, pointed in opposite directions.
This is not trivial. In a system with three or more charges, each charge feels a net force that is the vector sum of all pairwise Coulomb forces. The vector math gets complicated quickly, but the principle remains: each charge’s motion is determined by the sum of all forces acting on it.
Why This Matters Beyond the Visualization
Coulomb’s law is not a historical curiosity. It is the foundational law of:
– Capacitors — how devices store charge and energy – Semiconductors — the transistor action that makes computers possible – Electrolyte solutions — why salt dissolves in water and conducts electricity – Protein folding — the electrostatic forces between amino acid side chains
The same equation your phone uses to flip a transistor gate on and off is the equation that governs the van der Waals force between molecules, the Stark effect in atomic spectroscopy, and the charging of thunderclouds.
The Constant That Makes the Numbers Work
In Coulomb’s law, ke (Coulomb’s constant) is approximately:
ke ≈ 8.99 × 10⁹ N·m²/C²
This enormous number tells you something important: the electric force is strong. Much stronger than gravity at human scales. The reason you don’t get flung across the room by the electrical repulsion between electrons in your body and the floor beneath you is that matter is almost perfectly neutral — equal positive and negative charge cancels out almost completely.
Play with the chargeMagnitude slider in the visualization and watch how quickly the force arrows grow as you increase the charge values. This is why lightning is so dramatic — charge separation in a thundercloud can build to millions of volts. A relatively modest redistribution of charge (tiny compared to the total electrons in the cloud) produces a field strong enough to ionize air and create a conductive plasma channel.
What the Interactive Graph Reveals
The ability to toggle motion and watch the charges accelerate or decelerate is what transforms Coulomb’s law from an equation into intuition. Physics students who memorize F = kq₁q₂/r² often struggle to answer the question: what happens to the force when the charges start moving?
The answer is embedded in the law itself. The force depends only on position (distance), not on velocity — at least not until speeds approach a significant fraction of the speed of light, where special relativity modifies the result. At ordinary speeds, Coulomb’s law is instantaneous in the visualization because it ignores the finite propagation speed of electromagnetic fields (handled by Maxwell’s equations).
That lag, by the way, is why accelerating charges radiate electromagnetic waves and lose energy. But that is a story for another visualization.

