section
#>flow_field_literacy
gradient divergence curl

Math / Pure Structure

Vector calculus maps local change onto flow and fields.

When a space has a direction and magnitude at every point, it is described by a vector field. Vector calculus extends single-variable rates into directional operations. The gradient points most uphill on a hill. Divergence measures whether flow is generating or draining. Curl measures local rotation and spin. This page is built to provide concrete intuition first, linking these operations to wind systems in RPG world building and liquid patterns in culinary recipes (the reduction and mise en place registers are especially close) before diving into the formulas. If you want the rate foundation first, go to calculus. If you want the step-wise approximations that trace vectors over time, go next to numerical methods.

A mathematical signal field suggesting vector flow and circulation.
Directional fields Vector lines trace local orientation, allowing operations like divergence and curl to define flow behaviors across a continuous plane.
.expert_metaphors

Cross-Disciplinary Metaphors

We understand mathematical abstractions when they land in processes we can taste or play with. Use these frames to translate vector properties between physical cooking steps and game world structures.

Gradient (uphill push)

In the Kitchen: The heat profile in a cast-iron pan. The gradient points directly toward the hottest spot on the burner, guiding how you move ingredients (e.g. searing vs resting).

In RPG World Building: The map of danger or magical wealth. High gradient means threat levels spike rapidly over a short distance, cued by changing atmosphere or terrain.

Divergence (flux/sources)

In the Kitchen: Heat rising from a hot burner (positive divergence/source) vs cold ingredients absorbing heat (negative divergence/sink) in a simmering soup.

In RPG World Building: A monster spawner or magical portal acts as a source (positive divergence). A whirlpool or dungeon drain acts as a sink (negative divergence).

Curl (spin/circulation)

In the Kitchen: Stirring a gravy to prevent lumps. A circular motion creates curl, folding ingredients together without sending them flying off the edges.

In RPG World Building: A persistent wind cyclone, dust devil, or magical vortex. Characters caught in the field are pulled into circular orbits around the eye.

Trajectory (Euler stepping)

In the Kitchen: The path of a herb leaf floating in stirred stock. Step-by-step, the liquid's current decides where the leaf travels.

In RPG World Building: Pathing wind trade routes. A ship follows local wind vectors turn-by-turn to trace its voyage across the map.

^"vector_field_lab"{

Interactive Vector Field Lab

Select a vector field type and move the inputs. The vector grid shows flow direction. The probe outputs calculated values for divergence and curl at the coordinate. The dashed Euler path traces the trajectory step-by-step from the probe position, showing how local vectors dictate motion.

Interactive vector field visualizer An interactive vector field showing field arrows, a draggable probe, divergence and curl values, and a path traced via Euler integration.
If the controls are unavailable, read the default state as a vortex field with a probe at (1.0, 1.0). The vortex shows high curl and zero divergence, representing a pure circular flow.

Change coordinates or flow type to observe divergence and curl properties.

What changes

Moving the probe recalculates coordinate metrics and redraws the Euler integration trajectory.

anchor: interactive lab

What stays invariant

The vector field equations remain fixed for a given selection, defining uniform rules for divergence and curl across all coordinates.

anchor: operator math

What collapses

In rotational flows (vortex), divergence collapses to zero, showing that matter is not created or destroyed, only redirected.

anchor: divergence details

Where it leads

Euler integration shown here connects directly to numerical approximation. View how steps accumulate error next.

next: numerical methods lab
~"vector_operators"

Operators and Equations

These equations define the vector calculus toolkit. Subvocalize them by connecting the symbols to the flow patterns in the visualizer above.

∇f
scalar to vector slope direction

Gradient

∇f = (∂f/∂x, ∂f/∂y). Takes a height field (scalar) and produces a direction field (vector) pointing toward fastest local increase.

see: partial derivatives
∇·F
vector to scalar expansion rate

Divergence

div F = ∇·F = ∂Fx/∂x + ∂Fy/∂y. Measures localized flux. Positive values indicate a source (pushing out); negative values indicate a sink (drawing in).

see: source/sink settings
∇×F
vector to vector angular spin

Curl

curl F = ∇×F = ∂Fy/∂x - ∂Fx/∂y. Measures localized spin or vortex behavior around an axis. Zero curl indicates irrotational flow.

see: vortex setting
Euler
integration approximation

Euler Stepping

x_{k+1} = x_k + h · F_x(x_k, y_k). Appends small linear increments along the vector field to approximate continuous trajectories.

next: numerical methods
$"why_practice"

Why We Practice This Exercise

We don't compute vector derivatives only to pass academic exams. We practice vector field mathematics because it provides structural mechanisms for solving design, software, and simulation challenges:

Fluid and Wind Simulation

Whether simulating wind blowing across an RPG town or steam escaping from a boiled stock pot, we use Navier-Stokes solvers which resolve divergence and curl to enforce physical realism.

Game Physics and Particles

Particle systems (sparks, smoke, magic spells) follow velocity fields. Calculating particle positions turn-by-turn uses Euler stepping over vector fields to create natural flow patterns.

Gradient descent pathfinding

How does a character navigate toward safety or a target? By following the negative gradient of a distance field, avoiding obstacles by flowing downhill around them.

Procedural terrain generation

Perlin or Simplex noise uses gradients to generate natural-looking mountains and valleys, defining slope normals for light rendering.

&["flow_neighbors"]

Neighbor Routes

Vector fields connect local rate observations to physical trajectories and rendering maps. Follow these links to see where the abstractions land next:

Calculus

The rate foundation. Slicing surfaces to find partial derivatives prepares the field for gradient and divergence language.

route: multivariable shape

Numerical methods

Euler stepping in action. Explore how step size determines whether approximations stay stable or oscillate into divergence.

route: numerical methods

Differential equations

Slope fields are single-variable vector fields. Trace solution curves through slope directions.

route: slope fields

Software geometry

Laying out structures on curved surfaces. Poincare projection and hyper-dimensional meshes reuse vector principles.

route: geometry