Scalar Fields: Numbers Everywhere
A scalar field assigns a single number to every point in space.
That’s it — one number, everywhere. But this simple idea describes a surprising amount of the physical world.
Examples
- Temperature: At every point in a room, there’s a temperature. The air near the heater might be 28°C, by the window 18°C, at the ceiling 25°C. That’s a scalar field.
- Elevation: At every point on a hiking trail, there’s a height above sea level. That’s a scalar field.
- Pressure: At every point in the atmosphere, there’s an air pressure.
- Density: At every point in a fluid, there’s a mass density.
In each case: pick a point → get a number.
Each pixel’s colour represents the value of the field at that point. Red = high, blue = low.
Mathematical notation
A scalar field in two dimensions is a function $f(x, y)$ that takes coordinates $(x, y)$ and returns a number. In three dimensions: $f(x, y, z)$.
The heatmap above shows 2D scalar fields — colour encodes the value.
Why scalar fields matter
Scalar fields are the simpler sibling of vector fields. Temperature tells you “how hot” at each point, but not “which way the heat flows.” For that, you need a vector field — an arrow at every point, not just a number.
The gradient of a scalar field (the direction of steepest increase) produces a vector field. Temperature → heat flow. Elevation → downhill direction. Pressure → wind.