Reading a Gradient from a Contour Map
A contour map represents a scalar function by drawing curves on which the function has constant values. Those curves can provide useful information about the function’s gradient even when no formula for the function is available. The labels tell us how much the function changes; the spacing and orientation of the curves tell us how quickly and in which direction it changes.
The basic rule is local: near a point, the gradient points approximately perpendicular to nearby contours, toward increasing values. Its magnitude is estimated by dividing the change in function value by the perpendicular distance across which that change occurs. The estimate is most reliable when the contours are close enough to describe the behavior near the marked point and the map’s distance scale is known.
Direction and Magnitude
Suppose two nearby contours have values \(c_1\) and \(c_2\), and the values increase from the first contour toward the second. Let \(d\) be their local perpendicular separation, measured in the coordinate units shown on the map. The approximate rate of change in that direction is the value difference divided by the distance:
The perpendicular distance matters. If contours are nearly parallel, measure the shortest distance from one to the other, not an arbitrary distance along a slanted line. If the contours are closer together where their labels differ by a fixed amount, the function is changing more rapidly there.
The gradient points toward increasing function values and is normal, or perpendicular, to a contour at a regular point where the gradient is nonzero. Its magnitude represents the greatest local rate of increase per unit distance. If a map gives values in degrees Celsius and distances in kilometres, for example, the estimated gradient magnitude has units of degrees Celsius per kilometre.
Why the Spacing Rule Works
The rule comes from the local linear approximation for a differentiable function of two variables. For a small displacement \(\mathbf{h}\) from a point \(P\), the change in the function is approximately the gradient dotted with that displacement. This gives both the contour direction and the spacing estimate.
Along a contour, the function value is constant. If \(\mathbf{t}\) is a unit tangent direction to that contour, the directional rate in that direction is zero.
For a differentiable function, the rate in direction \(\mathbf{t}\) is \(\nabla f(P)\cdot\mathbf{t}\). Since the value does not change along the contour, \(\nabla f(P)\cdot\mathbf{t}=0\). Thus the gradient is perpendicular to the contour, provided it is nonzero.
Let \(\mathbf{n}\) be a unit normal pointing toward higher values, and let \(d\) be a small displacement distance in that direction. The local linear approximation gives \(f(P+d\mathbf{n})-f(P)\approx d\,\nabla f(P)\cdot\mathbf{n}\). Since \(\mathbf{n}\) points along the gradient, this is approximately \(d\,\lVert\nabla f(P)\rVert\).
If the contour values differ by \(\Delta c\), then \(\Delta c\approx d\,\lVert\nabla f(P)\rVert\), so \(\lVert\nabla f(P)\rVert\approx\Delta c/d\). The approximation reflects that the contours are separated by a finite distance and the gradient may vary across it.
This argument assumes differentiability near the point and uses contours close enough to describe local behavior. A contour map by itself does not guarantee that the function is differentiable, nor does it make a finite-spacing estimate exact. The estimate should be understood as a local approximation, not as a replacement for a derivative calculation when a formula is available.
Worked Examples
Worked Example: Parallel Contours with Eastward Increase
At a marked point, nearby parallel contours have values \(12\) and \(18\). The higher-value contour lies \(3\) metres east of the lower-value contour. Estimate the gradient and the rate of change in the unit direction \(\mathbf{u}=(3/5,4/5)\).
The value difference is \(18-12=6\), and the perpendicular spacing is \(3\) metres. Therefore the estimated magnitude is
The contours are locally vertical, so the normal direction is east-west. Values increase eastward, so the gradient estimate points east: \(\nabla f\approx(2,0)\).
The estimated directional rate is the dot product with the given unit direction:
As a check, the estimated change for a one-metre displacement in direction \(\mathbf{u}\) is the gradient dotted with that displacement, also \(6/5\) function units. Across the three-metre eastward spacing, the estimated change is \(2(3)=6\) function units, matching the contour labels.
Worked Example: Oblique Contours and a Marked Direction
Near a marked point, contour values rise from \(20\) to \(26\). The perpendicular separation is \(2\) kilometres, and the direction toward the higher contour is \(\mathbf{n}=(3/5,4/5)\). Estimate the gradient and the rate of change due east.
The value difference is \(26-20=6\). Thus the estimated gradient magnitude is
The given vector is a unit vector because \((3/5)^2+(4/5)^2=9/25+16/25=1\). It points toward increasing values, so
Due east is the unit direction \((1,0)\). The estimated rate in that direction is
To check the magnitude estimate, moving \(2\) kilometres in the normal direction gives the estimated change \(\nabla f\cdot(2\mathbf{n})=3(2)=6\) degrees Celsius, the difference between the contour values. The eastward rate is the east component of the estimated gradient, \(9/5\) degrees Celsius per kilometre.
Worked Example: Estimating Components from Crossings
At a marked point \(P=(2,2.5)\), a horizontal line through \(P\) crosses contours of values \(34.5\) at \((1,2.5)\) and \(38.5\) at \((3,2.5)\). A vertical line through \(P\) crosses contours of values \(36\) at \((2,2)\) and \(33\) at \((2,3)\). Estimate the gradient at \(P\), then estimate the rate in direction \(\mathbf{u}=(3/5,4/5)\).
Along the horizontal line, the distance between the two crossings is \(3-1=2\) coordinate units, and the value change is \(38.5-34.5=4\). The estimated \(x\)-component is therefore
Along the vertical line, the distance is \(3-2=1\) coordinate unit. As \(y\) increases, the value changes from \(36\) to \(33\), so
Combining these estimates gives \(\nabla f(P)\approx(2,-3)\). Its magnitude is \(\sqrt{2^2+(-3)^2}=\sqrt{13}\), and its estimated direction is \((2/\sqrt{13},-3/\sqrt{13})\). The rate in the requested direction is
As a check on the components, the horizontal estimate predicts a change of \(2(2)=4\) across the two-unit interval, matching \(38.5-34.5\). The vertical estimate predicts a change of \((-3)(1)=-3\) across the one-unit interval, matching \(33-36\). The negative directional rate means the estimated function value decreases as one moves in the specified direction.
Using the Map Carefully
Before estimating, check what the map’s scales mean. If one grid square represents two kilometres, a separation of three grid squares is six kilometres, not three. Use the physical coordinate distance represented by the map when calculating a rate. Also check that the contour labels increase in the direction you have assigned to the gradient; reversing that direction changes the signs of the estimated components.
| What to read | How it contributes |
|---|---|
| Contour labels | Give the change in function value |
| Perpendicular separation | Gives the distance used to estimate magnitude |
| Local contour orientation | Indicates the gradient’s normal direction |
| Increasing-value side | Chooses which way along the normal the gradient points |
| Marked direction | Combines with the gradient estimate to give a directional rate |
Contours may curve, bunch together, or spread apart. Estimate locally near the marked point rather than using a wide region where their spacing or orientation changes substantially. If the map gives only a few contours, the estimate may be coarse. If the contour values are rounded, the inferred rate is also limited by that rounding.
A Common Spacing Error
A frequent mistake is to use the distance between contours measured in a convenient direction rather than their perpendicular separation. For example, suppose contours with values differing by \(6\) have perpendicular spacing \(2\) kilometres, and their normal toward increasing values is \((3/5,4/5)\). The gradient magnitude estimate is \(6/2=3\), not a quotient using the horizontal gap.
For these contours, the horizontal gap between points at the same height is \(2/(3/5)=10/3\) kilometres: a horizontal displacement of \(10/3\) has normal component \((3/5)(10/3)=2\). Using that horizontal gap as though it were perpendicular would give the incorrect value
which underestimates the gradient magnitude. The correction is to use the shortest, perpendicular distance between the contours: \(6/2=3\). A horizontal displacement can still be used to estimate a horizontal component if the value change is measured along that horizontal displacement, but it is not the right distance for the full gradient magnitude.
From Gradient Estimate to Directional Rate
Once a gradient vector has been estimated, a directional rate at the same point is found by taking its dot product with the requested unit direction. If the direction is given by a nonzero vector \(\mathbf{v}\), first form the unit vector \(\mathbf{u}=\mathbf{v}/\lVert\mathbf{v}\rVert\). The result is an approximate rate per unit distance. A positive value indicates increase in that direction; a negative value indicates decrease.
Check Your Understanding
Use contour labels and local geometry to answer the following questions.
- Nearby contours differ by \(8\) function units and have perpendicular separation \(4\) metres. What is the estimated gradient magnitude?
- If contour values increase toward the west and the local contours are horizontal, which direction does the estimated gradient point?
- Why must the distance used for estimating gradient magnitude be perpendicular to the contours?
- An estimated gradient is \((3,4)\). What is the estimated directional rate in the unit direction \((0,1)\)?
- Give one reason why a gradient read from a contour map is only an estimate.