Gradients and Contour Maps

UniversityMathematicsAnalytic quadratic scalar field, exact gradient and directional derivative with sampled contour geometry

Unlock this lab with a pass

A pass opens every simulation on the site, including Present mode for class. The teaching notes below stay free for everyone.

One-time payment, no subscription.

About this experiment

Walk on a quadratic surface and compare its contour map, domain gradient and directional tangent. Change the coefficients to make a bowl, saddle, ridge or flat field and inspect where the gradient vanishes.

Learning goals

  • Calculate gradient components from a scalar field.
  • Compare a directional derivative with the projection of the gradient.
  • Relate contour orientation to local steepest ascent.

How to use it

  1. 1Click the surface and record the gradient at the new probe.
  2. 2Step uphill and downhill using the starting-point gradient direction.
  3. 3Turn the chosen domain direction and compare its directional derivative with gradient magnitude.
  4. 4Create a saddle and inspect the zero gradient at its centre.

The model

The coefficients define a general quadratic scalar field.
The gradient lives in the two-dimensional domain.
The maximum directional derivative equals the gradient magnitude.

Assumptions

  • The function, gradient and directional derivative are analytic. Contours use deterministic marching squares on a sampled grid.
  • Surface height is compressed by the reported display scale. The blue tangent follows the displayed height scale, while numerical derivatives use the original function.
  • Walking takes a finite step in the initial unit-gradient direction and clips at the displayed domain boundary. A large step is not guaranteed to decrease every possible quadratic.
  • Arrow lengths are capped for readability; use the numerical components for magnitudes.

Try this in class

  1. Q1Why can the gradient be zero at a saddle rather than a minimum?
  2. Q2Why does a direction tangent to a smooth contour give zero directional derivative?

Frequently asked questions

Is the gradient itself a three-dimensional tangent arrow?

No. It is a vector in the x-y domain. The blue arrow separately lifts the chosen domain direction to a tangent of the displayed graph.

Does a zero gradient make every nearby function value equal?

No. It means first-order change vanishes at that point. Curvature can still create a minimum, maximum or saddle.