Skip to main content

Module electric

Module electric 

Source
Expand description

Electric field computation — Coulomb’s law, field lines, dipoles, capacitors, line charges, and Gauss’s law verification.

Structs§

Capacitor
Parallel plate capacitor with uniform field between plates.
Dipole
Electric dipole: two equal and opposite charges separated by a small distance.
ElectricFieldLine
ElectricFieldRenderer
Renderer for electric field visualization.
LineCharge
Finite line charge with uniform charge per unit length.
PointCharge

Functions§

electric_field_at
Compute the total electric field at pos from multiple point charges via Coulomb superposition.
electric_potential_at
Compute the electric potential at pos from multiple point charges.
gauss_flux
Verify Gauss’s law: the electric flux through a closed surface equals Q_enc / eps0. surface_points and normals define the surface; normals point outward. Returns the total flux integral E · dA.
sphere_surface
Generate surface points and normals for a sphere centered at center with given radius.
trace_field_line
Trace a field line from start using RK4 integration.