0% found this document useful (0 votes)
45 views4 pages

Gradients and Normals

This document discusses gradients and normals in scalar fields. It defines the gradient as the direction of maximum rate of change of a scalar field. The gradient at a point represents the normal vector to the isosurface passing through that point. It also shows that the directional derivative of the scalar field in any direction is given by the dot product of the gradient and a unit direction vector. Therefore, the gradient gives both the direction of steepest increase and the normal to the isosurface at each point in the scalar field.

Uploaded by

Anshul Mahor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views4 pages

Gradients and Normals

This document discusses gradients and normals in scalar fields. It defines the gradient as the direction of maximum rate of change of a scalar field. The gradient at a point represents the normal vector to the isosurface passing through that point. It also shows that the directional derivative of the scalar field in any direction is given by the dot product of the gradient and a unit direction vector. Therefore, the gradient gives both the direction of steepest increase and the normal to the isosurface at each point in the scalar field.

Uploaded by

Anshul Mahor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

On-Line Visualization Notes

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

This is obviously the rate of change of f at p in the direction ~v .


To put this directional derivative in terms of the partials in the directions of the three coordinate axes, we
note that the ray p + t~v can be written in terms of its three components as
8
>
< xp + txv
p + t~v = > yp + tyv
: zp + tzv
Gradients and Normals Page 2 of 4

where p = (xp; yp ; zp) and ~v =< xv ; yv ; zv >. Then


@f
D~v f (p) =
@t
@f dx
= @x dt
+ @f dy
@y dt
+ @f dz
@z dt
@f @f @f
= @x
xv +
@y
yv +
@z
zv

using the chain rule.

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

D~v f (p) = rf (p)  ~v (1)

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.

The Gradient is in the Direction of Maximum Increase


From Equation (1) we have that

D~v f (p) = rf (p)  ~v


= jrf (p)jj~vj cos 
where  is the angle between the vector ~v and rf (p). Since jrf (p)j is constant, and ~v is a unit vector,
we see that this dot product is maximized when cos  = 1, or when  = 0. This says that the direction of
maximal increase of the function – i.e., where D~v f (p) is maximized – is when ~v is in the direction of the
gradient of f at p.

The Gradient at a Normal to Surfaces


Consider an isosurface of f , i.e., the surface where f (p) = c for some constant c. By letting c assume
all values, we obtain a family of surfaces, the level surfaces of f . For each point in space, exactly one level
surface of f will pass through the point.

Visualization On-Line Notes February 20, 1999– 12:18 pm


Gradients and Normals Page 3 of 4

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

rf (x; y) =< 2x; 2y > .


Given a point (x,y) on the circle f (x; y ) = r, we know by polar coordinates that (x; y ) = (r cos(t); r sin(t)).
The tangent vector ~t to this curve at (x; y ) is < ,r sin(t); r cos(t) > (just differentiate with respect to t),
which is equal to < ,y; x > .
We can see then that the gradient is perpendicular to the tangent vector since

rf (x; y)  ~t =< 2x; 2y >  < ,y; x >


= ,2xy + 2xy
=0
Thus, the gradient is normal to the curve.

Visualization On-Line Notes February 20, 1999– 12:18 pm


Gradients and Normals Page 4 of 4

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.

Visualization On-Line Notes February 20, 1999– 12:18 pm

You might also like