## Parametric surfaces

In class we discussed how a curve such as a circle can be described parametrically, by introducing an extra "parametric" variable t, that takes on values in the unit interval:

0 ≤ t ≤ 1

and defining x and y as functions of t:

x = cos(2 π t)
y = sin(2 π t)

Similarly, a surface such as a sphere can be described parametrically, by introducing two parametric variables u and v, and defining x, y and z as functions of u and v, where u and v take on values in the unit square:

0 ≤ u ≤ 1
0 ≤ v ≤ 1

and defining x, y and z as functions of u and v. In the case of a sphere, we can define these functions using longitude and latitude, which are familiar from geography. We let the x,y plane be the plane that contains the equator, and we let z be the direction toward the north pole.

First we use u and v to define the longitude angle θ and latitude angle φ, respectively:

θ = 2 π u
φ = π v - π/2

Note that the range of θ is 0 ≤ θ ≤ 2π and that the range of φ is -&pi/2 ≤ φ ≤ &pi/2.

Then we use these angles to define x, y and z:

x = cos θ cos φ
y = sin θ cos φ
z = sin φ

If we march along values of u between 0 and 1, and values of v between 0 and 1, then we can use the x,y,z coordinates defined along the way to trace out some points on the sphere, which can be used to create an approximation to the sphere made entirely of polygons:

As we discussed in class, if we march along u and v in smaller increments, then we create a better approximation to the sphere, but of course computational expense also goes up.