Parametric Surfaces and Their Areas
A parametric surface is a map from a flat parameter rectangle into space, . It is the two-parameter version of a space curve, and it covers shapes that are not graphs of : spheres, tori, helicoids, the inside of a pipe. This lesson builds the tangent vectors, the normal vector and the surface-area integral that the next three lessons rely on.
From curves to surfaces
A vector function traces a curve; a vector function of two variables traces a surface. Fixing and letting vary gives a grid curve; so does fixing . The gentle survey in Surfaces in 3D shows the common shapes; here we do the calculus on them.
| Surface | Parametrisation | Parameter domain |
|---|---|---|
| Graph | the region in the plane | |
| Sphere of radius | , | |
| Cylinder | , in an interval | |
| Cone | , | |
| Torus (tube radius around a circle of radius ) | ||
| Surface of revolution of about the -axis | , |
Tangent vectors and the normal
The partial derivatives and are tangent to the two grid curves through a point, so both lie in the tangent plane. Their cross product is perpendicular to that plane:
The surface is smooth where . A sphere's parametrisation fails this at the poles ( or ) even though the sphere itself is perfectly round there: smoothness is a property of the parametrisation, and a bad point can often be removed by choosing a different one.
Surface area
A small parameter rectangle is mapped to an almost-flat patch spanned by and . A parallelogram's area is the length of the cross product, so the patch has area . Summing and taking the limit:
For a graph , and the formula becomes the one from Surface Area: . The factor plays the same role as the Jacobian in change of variables: it measures how much the map stretches area.
Let SymPy do the cross product for a torus with and :
import sympy as sp
u, v = sp.symbols('u v', real=True)
R, b = 3, 1
r = sp.Matrix([(R + b*sp.cos(v))*sp.cos(u), (R + b*sp.cos(v))*sp.sin(u), b*sp.sin(v)])
n = r.diff(u).cross(r.diff(v))
nn = sp.simplify(n.dot(n))
print("|r_u x r_v|^2 =", sp.factor(nn))
mag = R + b*sp.cos(v) # positive, so it is the square root
print("check:", sp.simplify(mag**2 - nn) == 0)
area = sp.integrate(mag, (u, 0, 2*sp.pi), (v, 0, 2*sp.pi))
print("area =", area, "≈", round(float(area), 4))|r_u x r_v|^2 = (cos(v) + 3)**2
check: True
area = 12*pi**2 ≈ 118.4353
The general result is : the length of the centre circle () times the tube's circumference (). The outer half of the tube () is stretched more than the inner half, and the two effects average out exactly.
Area from a triangle mesh
A renderer never sees ; it sees triangles. Sampling the parameter grid, splitting each cell into two triangles and adding per triangle is a Riemann sum for the area integral. Here is the helicoid , , , a spiral ramp. Its normal has length , so the exact area is .
import numpy as np
def helicoid(u, v):
return np.stack([u * np.cos(v), u * np.sin(v), v], axis=-1)
def mesh_area(nu, nv):
u, v = np.meshgrid(np.linspace(0, 1, nu + 1), np.linspace(0, 2 * np.pi, nv + 1), indexing="ij")
P = helicoid(u, v)
a, b, c, d = P[:-1, :-1], P[1:, :-1], P[1:, 1:], P[:-1, 1:]
t1 = 0.5 * np.linalg.norm(np.cross(b - a, c - a), axis=-1)
t2 = 0.5 * np.linalg.norm(np.cross(c - a, d - a), axis=-1)
return float(t1.sum() + t2.sum())
exact = np.pi * (np.sqrt(2) + np.log(1 + np.sqrt(2)))
for n in (4, 16, 64, 256):
print(f"{n:>3} x {n:<3} grid: {mesh_area(n, n):.6f}")
print(f"exact : {exact:.6f}") 4 x 4 grid: 6.696128
16 x 16 grid: 7.170856
64 x 64 grid: 7.209204
256 x 256 grid: 7.211637
exact : 7.211800
The mesh area always comes out a little low: each flat triangle cuts a chord across the curved surface.
import numpy as np
import matplotlib.pyplot as plt
u, v = np.meshgrid(np.linspace(0, 1, 12), np.linspace(0, 2 * np.pi, 40))
x, y, z = u * np.cos(v), u * np.sin(v), v
fig = plt.figure(figsize=(6, 4))
ax = fig.add_subplot(projection="3d")
ax.plot_wireframe(x, y, z, linewidth=0.6)
ax.set_title("helicoid: grid curves u = const and v = const")
print("grid curves drawn:", x.shape[0] + x.shape[1])grid curves drawn: 52
In software
- Mesh normals. A vertex normal in a triangle mesh is a discrete . Summing un-normalised face cross products around a vertex weights each face by its area, which is why many engines do exactly that before normalising.
- Procedural geometry. Generators for spheres, tori, tubes along a path (cables, roads) and surfaces of revolution (vases, wheels) loop over , emit vertices , and emit normals from the analytic cross product instead of from the triangles, which gives smoother shading.
- Texture mapping. are literally the texture coordinates. tells you how much a texel is stretched on screen; UV unwrapping tools try to keep it nearly constant.
- Physics and printing. Cloth simulation, paint coverage and 3D-printing cost estimates all use the triangle-sum area above.
Exercises
Exercise 1: A tilted plane
For on the unit square , find and the area of the piece.
Answer
, area .
Solution
Exercise 2: Sphere area
Using the sphere parametrisation in the table, show and deduce the area of a sphere of radius .
Answer
.
Solution
(This order of , gives an inward-pointing normal; swapping them gives the outward one. The area does not care.)
Exercise 3: Tangent plane
Find the tangent plane to the cone at , .
Answer
(the plane ).
Solution
The tangent plane to a cone contains the whole line from the apex through the point, which is why it passes through the origin.
Exercise 4: A cone's side (code)
Compute the area of the cone , , by hand with the table's parametrisation, then confirm with mesh_area-style triangles.
Answer
.
Solution
With : , length . . The cone is flat in one direction (along ), so the only error in a mesh comes from the circular direction.
import numpy as np
u, v = np.meshgrid(np.linspace(0, 2 * np.pi, 401), np.linspace(0, 2, 41), indexing="ij")
P = np.stack([v * np.cos(u), v * np.sin(u), v], axis=-1)
a, b, c, d = P[:-1, :-1], P[1:, :-1], P[1:, 1:], P[:-1, 1:]
area = 0.5 * (np.linalg.norm(np.cross(b - a, c - a), axis=-1) + np.linalg.norm(np.cross(c - a, d - a), axis=-1)).sum()
print(round(float(area), 4), round(4 * np.sqrt(2) * np.pi, 4))17.7711 17.7715
Test yourself
For a parametric surface , what does represent?
- The volume under the surface
- The area of a tiny patch of the surface
- The curvature of the surface
- The length of a grid curve
The sphere parametrisation has at the poles. What does that mean?
- The sphere has a corner there
- The sphere has no tangent plane there
- Only that this parametrisation is not smooth there; the sphere itself is fine
- The area integral diverges
A torus has centre-circle radius and tube radius . What is its area?