Multivariable Calculus · Level surface

Level surface

A level surface of a function F(x, y, z) is the set of points where F takes one value c. Given this way, by an equation rather than a formula for its points, it is an implicit surface; where the gradient of F is not zero, it is perpendicular to it.

Level surfaces in this visualization

A function F(x,y,z)F(x, y, z) gives a number at every point of space. The points where it takes one value cc form a level set; near any of its points where ∇F≠0\nabla F \ne \mathbf 0 it is a surface, the level surface F=cF = c. It is the three-dimensional version of the lines on a contour map. A surface given by an equation like this is called implicit: the equation tells you whether a point is on the surface but does not hand you its points. A parametric surface is the other way round.

A level surface and its normal
{(x,y,z):F(x,y,z)=c},∇F(P)⊥the surface at P if ∇F(P)≠0\{(x, y, z) : F(x, y, z) = c\}, \qquad \nabla F(P) \perp \text{the surface at } P \text{ if } \nabla F(P) \ne \mathbf 0

Turning c

Most of the time a small change in cc moves the surface a little. For x2+y2−z2x^2 + y^2 - z^2, the cross-section at z=0z = 0 is x2+y2=cx^2 + y^2 = c: the waist shrinks as cc falls to 0, and for c<0c < 0 the surface cannot cross that plane at all, so it comes apart into two sheets. The torus’s hole closes at c=9/4c = 9/4. Near a point where FF is continuously differentiable and ∇F≠0\nabla F \ne \mathbf 0, the level set is a smooth piece of surface (the implicit function theorem), and nearby values of cc give nearby pieces. At the tip of the double cone the gradient is 0\mathbf 0; where the torus’s hole closes, on the z-axis, the FF used here has no gradient at all.

Why the gradient is perpendicular

Take any curve r(t)\mathbf r(t) that stays on the surface. Along it F(r(t))=cF(\mathbf r(t)) = c does not change, so its derivative is 0, and by the chain rule ∇F⋅r′(t)=0\nabla F \cdot \mathbf r'(t) = 0. The gradient is perpendicular to the velocity of every curve through the point, so it is perpendicular to the surface. Where ∇F(P)≠0\nabla F(P) \ne \mathbf 0, that gives the tangent plane at PP directly: ∇F(P)⋅(X−P)=0\nabla F(P) \cdot (X - P) = 0. For the sphere x2+y2+z2=4x^2 + y^2 + z^2 = 4, ∇F=(2x,2y,2z)\nabla F = (2x, 2y, 2z) points straight out from the centre.

How a computer draws it

There is no list of points to plot, so the computer samples FF on a grid of small cubes. Wherever F−cF - c changes sign along an edge, the surface crosses that edge; estimating where, and joining those points with triangles, gives a surface made of flat pieces. A finer grid gives more and smaller triangles. Thickening the surface to ∣F−c∣≤w|F - c| \le w turns it into a wall. Here ww is measured in values of FF, so the wall is about 2w/∣∇F∣2w/|\nabla F| across and thinner where FF changes fast. 3D printers fill solid parts with such walls, and the gyroid is a favourite. The formula used here is a sum of sines and cosines; its zero level set closely approximates the true gyroid, but is not the minimal surface itself.

Things to notice

  • The graph of z=f(x,y)z = f(x, y) is the level surface z−f(x,y)=0z - f(x, y) = 0, but a whole sphere or torus cannot be written as one single-valued z=f(x,y)z = f(x, y).
  • A level set can be empty (x2+y2+z2=−1x^2 + y^2 + z^2 = -1) or a single point (=0= 0).

Controls

  • Drag P over the surface; drag anywhere else to turn the view. Arrow keys move P round the z-axis and change c.
  • The grid knob sets how many cubes each side of the box is cut into; turning it shows the triangles.

Related