Gradients and Normals
Gradients and Normals
Kenneth I. Joy
Visualization and Graphics Research Laboratory
Department of Computer Science
University of California, Davis
Overview
If we consider a scalar field in space given by the function f (x; y; z ), we know that the first partial deriva-
tives of f are the rates of change of f in the directions of the coordinate axes. The gradient of f , rf is the
direction of maximum rate of change of the function at any point. When generating isosurfaces, this gradient
forms the normal vector to the isosurface at any point. This document develops the gradient from directional
derivatives, and shows that the gradient to a point can represent the normal to the isosurface through the point.
Directional Derivatives
Given a point p in space, and a unit direction vector ~v at p. The directional derivative of f at p in the
direction ~v , denoted D~v f (p) is given by
f (p + t~v ) , f (p)
D~v f (p) = lim
t!0 t
Gradients
We call the vector
@f @f @f
< ; ; >
@x @y @z
the gradient of f , and denote this as rf . It should be clear from the above that the directional derivative of
f at p in the direction ~
v is given by
We note that if the vector ~v is in the direction of the x axis, then D~v f (p) = @x
@f
. Similar results hold for the
y and z axes respectively.
Any curve in space can be written as p(t) for a parameter t, and if we require this curve to be on the
isosurface f (p) = c, we have that
f (p(t)) = c
Differentiating this with respect to t and using the chain rule, we have that
@
0 = @t f (p(t))
= @f dx
@x dt
+ @f dx
@y dt
+ @f dx
@z dt
= rf p0 (t)
Here we have separated p(t) into its component form, p(t) = (x(t); y (t); z (t)) and
p0 (t) =<
dx
dt
(t); dy
dt
(t); dz
dt
(t) >
Therefore, the gradient is perpendicular to the tangent vector of the surface at p, for any curve p(t) on the
surface that passes through p. So the gradient must be in the direction of the normal to the surface.
A Two-Dimensional Example
Consider the scalar field given by the function
f (x; y ) = x2 + y 2
which has a set of circles as the level curves of the field. The gradient of f is equal to
Summary
The gradient of a scalar field f is an important concept in visualization. The gradient of f represents the
direction of maximum change in the function f , and can be used as the normal to level surfaces of the scalar
field.