2D Vector Field Visualizer Back
Math & Physics

2D Vector Field Visualizer

Switch between canonical 2D fields — uniform flow, point source, free vortex, dipole and saddle — and adjust strength and arrow density. Click on the canvas to drop streamline seeds; double-click to clear.

Field
Layers
Arrows
Streamlines
Magnitude colormap
Click on the canvas to add a streamline seed. Double-click to clear seeds.
Cursor probe
|v| at cursor
curl ∂v/∂x − ∂u/∂y
Click to seed streamlines · Double-click to clear
Theory & Key Formulas

Source: \(\vec F = \dfrac{Q}{2\pi}\dfrac{\hat r}{r}\)

Free vortex: \(\vec F = \dfrac{Q}{2\pi}\dfrac{\hat\phi}{r}\)

Saddle: \(\vec F = (Qx, -Qy)\)

Divergence \(\nabla\cdot\vec F\) and curl \(\nabla\times\vec F\) classify the field topology.

What this visualizer shows

🤩
Why are some fields drawn as outward arrows and others as swirls?
🎓
A point source has positive divergence and zero curl — flow leaves every neighbourhood. A free vortex has zero divergence and a delta-function curl at the origin — flow rotates without expanding. Switch between "Point source" and "Free vortex" and watch the streamlines rearrange.
🤩
What is the saddle case?
🎓
A linear hyperbolic field that pulls in along one axis and pushes out along the other. It models the flow near stagnation points and is the bread-and-butter example for stability analysis in dynamical systems.
🤩
Where is this useful in CAE?
🎓
Potential-flow superposition (uniform + source + dipole = Rankine oval, for example) gives quick analytic insight before launching a CFD case. The same arrow plot machinery is what your CFD post-processor uses for velocity vectors and electric field plots.

Physical model

A 2D vector field assigns a vector $\vec F(x,y)$ to every point. The simulator visualises it three ways: discrete arrows on a grid, integrated streamlines, and an optional magnitude colormap. The streamlines are obtained by integrating $\dot{\vec r}=\vec F/|\vec F|$ with a fixed step.

Two scalar quantities classify the field. Divergence $\nabla\cdot\vec F = \partial_x u + \partial_y v$ measures local outflow; curl $\nabla\times\vec F = \partial_x v - \partial_y u$ measures local rotation. The cursor probe estimates these numerically by central differences.

Real-world applications

Aerodynamics: potential-flow combinations of uniform, source, dipole and vortex elements model lift and bluff-body flow before viscous CFD is run.

Electromagnetism: the same equations describe 2D electrostatic and magnetostatic fields. Source = positive charge, dipole = electric dipole, vortex = magnetic field of a long wire.

Dynamical systems: phase-plane analysis of ODE systems uses exactly this kind of arrow plot to diagnose fixed-point stability.

FAQ

What is divergence?
The local outflow per unit area: $\nabla\cdot\vec F=\partial_x u+\partial_y v$. Positive at sources, negative at sinks.
What is curl?
The infinitesimal rotation rate: $\nabla\times\vec F=\partial_x v-\partial_y u$. Positive curl rotates a small paddlewheel counter-clockwise.
Why does the source field blow up at the origin?
Because $|\vec F|\sim 1/r$ for a 2D point source, the magnitude diverges at $r\to 0$. Real engineering analogues are always smeared over a finite size, but the singular form is a useful mathematical building block.