Overview
A scalar field φ assigns a number to each point in space.
It can be visualised via a heat map (colour coding the value)
or via level sets (curves or surfaces where φ is constant).
In 2D we can plot the graph z = φ(x,y)
and visualise the scalar field as a surface.
The gradient of φ, written ∇φ, is a vector field that
points in the direction of greatest increase of φ, with magnitude
equal to the rate of change:
In 2D: ∇φ = (∂φ/∂x, ∂φ/∂y)
In 3D: ∇φ = (∂φ/∂x, ∂φ/∂y, ∂φ/∂z)
∇φ is always perpendicular to the
level sets of φ. Where the level sets are closely spaced, |∇φ| is
large; where they are far apart, |∇φ| is small.