Physics · Intermediate

Electric field of point charges

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A point charge creates an electric field that fills the space around it. The field at a point tells us the force per unit positive charge, falls off as the inverse square of distance, and for several charges the fields add as vectors (superposition).

Intuition

Imagine a charge as a source that 'announces' its presence to space. Instead of asking how two charges push on each other, we ask what the first charge does to space itself: at every point it assigns an arrow, the field. A small positive test charge placed there feels a force along that arrow. A positive source gives arrows pointing away, a negative source gives arrows pointing in. The arrows weaken as 1/r2 because the influence spreads over a sphere whose area grows as r2. With many charges, each contributes its own arrow, and the real field is the vector sum. This is why symmetric arrangements, like dipoles, can have cancelling components.

Key equations

E→=14πε0qr2r^
(1)

Field of a point charge q at distance r; points away from q if q>0

F→=q0E→
(2)

Force on a test charge q0 placed in the field

E→net=∑i14πε0qiri2r^i
(3)

Superposition: total field is the vector sum of individual fields

Derivation

  1. Start with Coulomb's law: force between source charge q and test charge q0 is F=kqq0r2, with k=14πϵ0.
  2. Define the field as force per unit test charge in the limit of a small test charge: E = F/q0.
  3. Divide: E=kqr2, directed along the line joining the charges, away from q if q is positive.
  4. For several sources, forces on q0 add vectorially, so dividing by q0 gives that fields add vectorially.
  5. Write each term with its own distance r_i and unit vector r_i-hat pointing from charge i to the field point; sum components separately.

Worked example

Problem

A charge +2.0 nC sits at x = 0 and a charge -2.0 nC sits at x = 4.0 m on the x-axis. Find the net field at x = 2.0 m (midpoint). Use k = 8.99e9 N m^2/C^2.

  1. Distance from each charge to the midpoint is r = 2.0 m.
  2. Magnitude from each: E = kq/r^2 = (8.99e9)(2.0e-9)/(4.0) = 4.5 N/C.
  3. The +2 nC charge pushes away from itself: toward +x at the midpoint.
  4. The -2 nC charge pulls toward itself: also toward +x.
  5. Both point the same way, so they add: 4.5 + 4.5 = 9.0 N/C.

Answer About 9.0 N/C in the +x direction (toward the negative charge).

Common mistakes

  • Adding field magnitudes instead of vectors, ignoring directions.
  • Forgetting that the field direction for a negative source points toward it.
  • Using the distance between the sources instead of the distance from each source to the field point.
  • Thinking the source charge feels its own field.
  • Using 1/r instead of 1/r2, or forgetting to convert nC to C.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

scene.py(91 lines)
import sys
import numpy as np
from manim import *
from blocks import *

K = 1.0
CHARGES = [(-2.0, 0.0, 1.0), (2.0, 0.0, -1.0)]  # (x, y, q): a dipole


def field(x, y, charges=CHARGES):
    """Coulomb field (Ex, Ey) of point charges, k=1."""
    ex = ey = 0.0
    for cx, cy, q in charges:
        dx, dy = x - cx, y - cy
        r = np.hypot(dx, dy) + 1e-12
        ex += K * q * dx / r**3
        ey += K * q * dy / r**3
    return ex, ey


def trace_line(x0, y0, sign=1, step=0.05, n=400):
    """Integrate a field line with fixed Euler steps; stop near a charge or off-screen."""
    pts = [(x0, y0)]
    x, y = x0, y0
    for _ in range(n):
        ex, ey = field(x, y)
        m = np.hypot(ex, ey) + 1e-12
        x += sign * step * ex / m
        y += sign * step * ey / m
        pts.append((x, y))
        if abs(x) > 5.5 or abs(y) > 2.6:
            break
        if any(np.hypot(x - cx, y - cy) < 0.15 for cx, cy, _ in CHARGES):
            break
    return pts


def build_lines():
    """Field lines start on a ring around the positive charge."""
    lines = []
    cx, cy, _ = CHARGES[0]
    for a in np.linspace(0, 2 * np.pi, 12, endpoint=False):
        lines.append(trace_line(cx + 0.2 * np.cos(a), cy + 0.2 * np.sin(a)))
    return lines


class Main(Scene):
    def construct(self):
        self.camera.background_color = "#101418"
        TitleCard(self, "Electric field of point charges", "E = k q / r^2")
        lines = build_lines()
        # charges
        mobs = VGroup()
        for cx, cy, q in CHARGES:
            col = C_BAD if q > 0 else C_MAIN
            d = Circle(radius=0.2, color=col, fill_color=col, fill_opacity=1).move_to([cx, cy, 0])
            s = Text("+" if q > 0 else "-", font_size=24, color=BLACK).move_to(d)
            mobs.add(VGroup(d, s))
        self.play(FadeIn(mobs))
        StepCaption(self, "Field lines leave + and end on -")
        # field lines from computed traces
        curves = VGroup()
        for pts in lines:
            p = [np.array([x, y, 0]) for x, y in pts]
            curves.add(VMobject(color=C_ACCENT, stroke_width=3).set_points_as_corners(p))
        self.play(*[Create(c) for c in curves], run_time=3)
        # field vectors at sample points
        arrows = VGroup()
        for x, y in [(0, 1.5), (0, -1.5), (0, 0), (4.0, 1.0), (-4.0, 1.0)]:
            ex, ey = field(x, y)
            m = np.hypot(ex, ey)
            v = np.array([ex, ey, 0]) / m * 0.8
            arrows.add(Arrow([x, y, 0], np.array([x, y, 0]) + v, buff=0, color=C_GOOD,
                             stroke_width=5, max_tip_length_to_length_ratio=0.35))
        self.play(FadeIn(arrows))
        StepCaption(self, "Arrows show E direction; denser lines mean stronger field")
        self.wait(1.5)
        StepCaption(self, "Field strength falls as 1/r² and lines never cross")
        self.wait(1)


if __name__ == "__main__" and "--selftest" in sys.argv:
    ex, ey = field(0, 0)
    assert ex > 0 and abs(ey) < 1e-9
    e = field(3, 0, [(0, 0, 1.0)])
    assert abs(e[0] - 1 / 9) < 1e-12
    assert abs(field(1, 1)[1] + field(1, -1)[1]) < 1e-12
    ls = build_lines()
    assert len(ls) == 12 and all(len(l) > 5 for l in ls)
    assert any(np.hypot(l[-1][0] - 2, l[-1][1]) < 0.2 for l in ls)
    print("ok")

The Manim scene code that draws this lesson's animation in the Signals AI app (Python, Manim Community).

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.