Joe Lertola · Mathematical Handbook Big idea 8 of 12

The landscape

From the handbook: Differentiation and Integration of Functions of Several Variables, §419–450, pages 626–662

Slope on a surface has a direction, and two numbers describe it.

Vygodsky's Mathematical Handbook
The surface. Drag to turn it, scroll to zoom.
The map from above. Drag the orange point.
East–west slice through the point. Its slope is ∂z/∂x.
South–north slice through the point. Its slope is ∂z/∂y.
Height z
East slope ∂z/∂x
North slope ∂z/∂y
Steepness
Uphill points

A landscape is a rule

Picture a map with a grid on it, like a street map. Any spot on the map can be named by two numbers: x, how far east it is, and y, how far north it is. These are the same two coordinates as on any graph.

Now give every spot a height. Call the height z. If you know where you are standing (x and y), the landscape tells you how high you are (z). Two numbers go in, one number comes out.

The thing that turns the two numbers into the height is called a function. Think of it as a rule, or a machine: feed it a position and it hands back a height. Mathematicians give the rule a short name, usually f, and write

z = f(x, y)

Read it aloud as “z is f of x and y”, meaning “the height is what the rule gives you for this position”. The letter f doesn't stand for a number. It stands for the rule itself.

A very simple example of a rule is f(x, y) = x + 2y. Standing at x = 3, y = 1, the height is 3 + 2 × 1 = 5. That rule makes a tilted flat ramp. The hills in this demo use more complicated rules, but the idea is the same. A real terrain file (a DEM in TopoToImage) is this kind of rule written out as a table: a grid of positions, each with its height.

Here the landscape is built the way a computer stores terrain: a grid of heights joined into flat triangles.

Two slopes, one for each direction

On a hillside, “how steep is it?” depends on which way you walk. Walking along the side of the hill may be level, while walking straight up it is steep. So one number isn't enough to describe slope on a surface. It takes two.

The east slope. Stand still, then take a small step due east. Your x changes, your y stays the same, and your height changes a little. Divide the change in height by the length of the step and you have the slope going east, the same rise over run as on a roof or a road sign. Mathematicians write it as

∂z / ∂x

Read it as “the change in z for a small change in x”. The curly ∂ is a rounded letter d, short for “a tiny difference in”. So ∂z/∂x is a tiny change in height divided by a tiny step east. It is called a partial derivative: “derivative” because it is a rate of change, “partial” because only one of the two inputs is allowed to change while the other is held fixed.

The north slope. Do the same thing walking due north: y changes, x stays the same. That slope is written ∂z/∂y.

Back to the ramp z = x + 2y. A step of 1 east raises you by 1, so its east slope is 1. A step of 1 north raises you by 2, so its north slope is 2. Climbing this ramp is twice as hard walking north as walking east.

A positive slope means uphill in that direction, a negative one means downhill, and zero means level. The blue and pink panels below the map show exactly these two walks through the orange point, with the slope of each.

Putting the two slopes together

Draw an arrow that goes as far east as the east slope and as far north as the north slope. For the ramp that is 1 east and 2 north. That arrow points in the steepest uphill direction, and its length tells you how steep it is there. On the map it is the orange arrow (scaled to fit), drawn from its blue east leg and its pink north leg. Its length comes from Pythagoras: for the ramp, √(1² + 2²) ≈ 2.24.

Turn it around and it points the way water runs: straight downhill. That is what the white arrows on every triangle show. On a flat triangle the slope is the same everywhere, so each triangle has one pair of slopes and one arrow.

Try this

  1. Set the grid to 3 × 3. The landscape becomes eight flat triangles, and every spot on one triangle has the same slope. Drag the point across an edge and watch the numbers jump.
  2. Look where the arrows meet the contour lines: always at a right angle. Along a contour the height does not change, so the steepest way up must go straight across it.
  3. Choose Saddle and drag the point to the center. Both slopes read zero, yet it is neither a top nor a bottom: up to the east and west, down to the north and south. This is a pass.
  4. Now slide the grid up to 41. The triangles shrink until the surface looks smooth, and the triangle under the point becomes the tangent plane. Calculus treats every curved surface this way: flat, if you look closely enough.
  5. Pick Random with a coarse grid and follow the white arrows. Where would rain collect? That is the start of a drainage network.

In the book

Vygodsky, Mathematical Handbook: Higher Mathematics, chapter “Differentiation and Integration of Functions of Several Variables”.

  • §419, §421 A function of two arguments, and how to show one: as a surface or as a contour map. p. 626–628
  • §425–426 Partial derivatives, pictured as the slopes of two slices through the surface, just like the two panels above. p. 634–635
  • §430–431 The total differential: how the two slopes combine for a step in any direction. p. 638–640
  • §435–437 The tangent plane and the normal to a surface. p. 643–646
  • §448–450 Maxima and minima, and the test that tells a peak from a pass. p. 660–662