# Spherical Coordinates

In the last module we looked at cylindrical coordinates -- a system of coordinates that is very useful when the important things about a three-dimensional point are its distance from the z-axis and its angle from the positive xz-plane. In this module we look at situations in which the important things about a point are its distance from the origin and, using terms from geography, its latitude and longitude. In this situation we use spherical coordinates.

(rho, phi, theta)

or

• The first of these coordinates -- rho -- denotes the point's distance from the origin. The movie below shows the sets of points with rho = 0.2, 0.3, ... 1.0.

• The second coordinate -- phi --is very similar to latitude. Think of yourself as located at the origin with your right hand pointing straight upward along the positive z-axis. Then face the point in question and lower your right hand until it is pointing at this point. The angle by which your right hand is lowered is the coordinate phi. Notice if phi = 0 then the point is on the positive z-axis; if phi = pi / 2 then the point is in the xy-plane; and if phi = pi then the point is on the negative z-axis. The movie below shows points with constant values of phi for phi = 0, pi / 16, 2 pi / 16, ... pi.

• The third coordinate -- theta -- is identical to the coordinate theta used in cylindrical coordinates. It measures the angle from the positive xz-plane to the point. The movie below shows points with constant values of theta.

This system of coordinates is very similar to the system -- longitude and latitude -- of coordinates used to describe points on the earth's surface. You may want to look at the module The Earth is Round -- Most Maps are Flat.

Units

It is important to be aware of the units used with different coordinate systems. In Cartesian coordinates,

(x, y, z),

all three coordinates measure length and are in units of length. In spherical coordinates

(rho, phi, theta),

only the first coordinate measures length and is in units of length. The other two coordinates measure angles and, thus, are dimensionless because angles measured in radians have no "units."

Converting Back-and-Forth from Spherical to Cartesian Coordinates

The pictures below are the key to converting from spherical to Cartesian coordinates and vice-versa.

The picture on the right shows the xy-plane from the picture on the left. Notice that, by the Pythagorean Theorem

Thus, we can convert from spherical to Cartesian coordinates by

Notice that the units work out correctly because angles measured in radians and the usual trigonometric functions are dimensionless -- that is, have no associated units.

We convert from Cartesian to spherical coordinates by

The angle theta is sometimes called the angle of ascension and the angle phi is sometimes called the angle of declination.

Warning: The notation for spherical coordinates is not standard. Sometimes they are written in a different order and sometimes the letters phi and theta are interchanged. In short, be careful when using spherical coordinates. You cannot assume that when someone else uses notation that looks like the notation here it is being used the same way.

1. Find the spherical coordinates of the point whose Cartesian coordinates are (1, 2, 3).

2. Find the Cartesian coordinates of the point whose spherical coordinates are (5, pi/3, pi/4).

3. Find the cylindrical coordinates of the point whose spherical coordinates are (5, pi/3, pi/4).

4. Find the spherical coordinates of the points whose cylindrical coordinates are (5, pi/6, 10).

Phong's Model -- Improved

 We are now in a position to add another element of realism to our model (Phong's Model) of specular lighting. Phong's model says that the fraction of incident light that is reflected from a point on a surface toward a viewer is k cosn phi where phi is the angle between the line from the point to the viewer and the line from the point pointing in the direction of perfect mirrorlike reflection. The constant k depends on the intensity of the incident light and the physical make-up of the surface -- the fraction of the incident light that is reflected by the surface. When the constant n is very large the surface is very shiny and when the constant n is small it is more semi-glossy or even satin-like. The graph below shows the functions cosn phi for n = 1,2, ... 10. As n gets larger and larger, the functions tail off more quickly for values of phi other than 0. This corresponds to the fact that a shiny surface reflects most of the light very close to the direction of perfect mirrorlike reflection. But this graph tells only half of the story. All the functions in this graph have the same maximum value -- 1 at phi = 0 This agrees with our model so far because we have the same constant k in Phong's formula k cosnn phi regardless of the value of n. This is unrealistic and it is this phenomenon that we can now address.

From now on we will write Phong's formula as

kn cosnn phi

to indicate the fact that we need different constants for different values of n.

The reason we need different constants for different values of n is that when n is large most of the light is reflected very close the the direction of perfect mirrorlike reflection. Thus, the same total amount of outgoing light is more concentrated near the direction of perfect mirrorlike reflection.

We let T denote the total amount of light reflected in all directions from the given point. To make our computations simpler we will assume that T = 1 milliwatt. The actual value of the constant T depends on two factors -- the intensity of the incident light and the reflectivity or albedo of the surface (the fraction of incident light that is reflected).

 The picture at the left shows a hemisphere of radius rho centimeters centered at the point in question. The z-axis in this picture is pointing in the direction of perfect mirrorlike reflection. This hemisphere will capture all the light reflected by the point in question. We can use this fact together with spherical coordinates to determine the values of the constants kn. Phong's model tells us the intensity of reflected light received by each point on this hemisphere (kn cosnn phi) / (2 Pi rho2) The factor 2 Pi rho2 in the denominator comes from the fact that the light intensity at a point is inversely proportional to the area of the hemisphere centered at the origin whose radius is the distance from the point to the origin.
If the amount of light received by each point was constant we would have

1 milliwatt = (constant) (Area of hemisphere)

since the total amount of reflected light is 1 milliwatt. But the intensity is not the same at each point on the hemisphere and simple multiplication must be replaced by integration.

This integral can be thought of as multiplying the nonconstant amount of light received by each point on the hemisphere by the area of the hemisphere.

Both sides of the equation above are measured in units like milliwatts. The left side is the total amount of light received by the hemisphere. The constant kn on the right side depends on the total amount of light that is incident on the point being studied and its albedo and is measured in milliwatts. The radius, rho, of the hemisphere is measured in units of length, and the symbol dA represents the area of a small section of the hemisphere and is measured in units of length2.

We can approximate this integral by breaking the hemisphere into small pieces as follows.

• We begin as usual with a positive integer N that controls the number of pieces.

• For the whole hemisphere the angle phi ranges from 0 to pi / 2. We break this range into N equal intervals. Similarly, the angle theta ranges from 0 to 2 pi and we break this range into N equal intervals. We use the notation

• The picture above shows the hemisphere broken up in this way. Notice that the different sections have different sizes or areas. The sections are roughly "rectangular." The "height" and "width" are measured along the hemisphere. All the heights are the same -- namely,

rho pi / (2 N)

since the hemisphere has radius rho. But the widths are different. The sections near the north pole of the hemisphere are much thinner than those near its equator.

• Consider a circle of "latitude" phi as shown in the figure below.

The radius of this circle is rho sin phi, so its circumference is 2 pi rho sin phi. When this line is divided into N equal pieces, the length of each piece is

(2 pi rho sin phi) / N

• Thus, the area of each section is approximately

Notice that the units work out as expected. The only quantity in the formula above that has associated units is rho which is measured in units of length. Thus, as expected, area is measured in units of length2.

for the total amount of light received by the hemisphere. The exact answer is the limit

The sums above are exactly the sums that would be used to estimate the integral

using Cartesian coordinates where P is the region shown in the picture below.

This integral can be evaluated using either of the iterated integrals.

or

Since the total amount of light received by the hemisphere is 1 milliwatt we have

and

Units

As usual it is worthwhile to take a close look at the units involved in these calculations. We are interested in an integral that can be written in various ways.

In (1) and (2) the symbol

is used two different ways. In (1) it represents a small section of the hemisphere H and is measured in units of length2. In (2) it represents a section of the region P shown below and is dimensionless because the angles phi and theta are dimensionless.

Formula (3) is mathematically identical to formula (2) but the units are not very explicit. For this reason we examine formula (2) more closely.
 This constant is measured in units like milliwatts. This is the intensity of the light measured at a point on the hemisphere. It is measured in units like milliwatts per length2. This is the area of a little section of the hemisphere and is measured in units of length2. Notice that dA is a section of the region shown below and is dimensionless. The integrand is measured in units of milliwatts and the final result is measured in the same units.

1. Compute the constants kn for n = 1, 2, ... 10 and then graph the functions

kn cosn phi

to see the way that the glossiness of a surface affects the brightness of the highlights -- that is, to get a better feeling for Phong's model for specular lighting.

2. Use the ideas developed above to find the portion of the earth's surface that is within 10 degrees latitude of the equator. Assume that the earth is a sphere.

3. Use the ideas developed above to find the portion of the earth's surface that is within 10 degrees latitude of the North pole. Assume that the earth is a sphere.

4. A circle of radius r on the plane has an area of pi r2. Find the corresponding formula for a circle of radius r drawn on a sphere of radius R.

5. A circle of radius r on the plane has a circumference of 2 pi r. Find the corresponding formula for a circle of radius r drawn on a sphere of radius R.

6. The earth is roughly a sphere whose radius is 6367 kilometers. Find the total surface area of the earth.

7. Find the total surface area of the earth that is located within 10 degrees of the equator.

Copyright c 1997 by Frank Wattenberg, Department of Mathematics, Montana State University, Bozeman, MT 59717