Back

Divergence and Curl Visualizer

What you are seeing: a parameterized 2D vector field drawn as a grid of arrows. The two numerical readouts are the divergence and curl evaluated at the center of the plot (or at any chosen point - here the origin). Four field families are available: radial source (uniform divergence, zero curl), uniform rotation (zero divergence, uniform curl), shear (zero divergence, constant negative curl), and saddle (both zero everywhere).

The scalar parameter aa scales each family uniformly. For the source family, F=2a\nabla \cdot \mathbf{F} = 2a is independent of position; for the rotation family, ×F=2a\nabla \times \mathbf{F} = 2a is similarly uniform. Watching the arrows reorganize as you slide aa makes the differential operators visceral.

Figure 1. Divergence and curl of a parameterized 2D vector field. Method: analytic derivatives; finite-difference cross-check in the invariants test.
family rotation
a1.00

WHAT TO TRY

  • Switch families: a source sprays the tracers outward (div > 0), a sink pulls them in (div < 0), a vortex spins them with zero divergence, and a shear or saddle mixes the two.
  • Read the inset: flux and circulation through the dashed loop both grow as r squared, the area scaling of the divergence and Green theorems. Flux tracks div, circulation tracks curl.
  • A pure rotation has div = 0 but curl = 2a: the arrows never point outward, yet the loop still has net circulation. Divergence and curl are independent.