If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Parametric functions, two parameters

To represent surfaces in space, you can use functions with a two-dimensional input and a three-dimensional output.

What we're building to

  • You can visualize a function with a two-dimensional input and a three-dimensional output by plotting all the output points corresponding to some region of the input space. This results in a surface, known as a parametric surface.
  • The process of going the other way around, starting with a surface in space and trying to find a function that "draws" this surface, is known as parameterizing the surface. In general, this is a tricky thing to do.

Quick review of one-parameter functions

In the last article, I talked about visualizing functions with a one-dimensional input and a two-dimensional output. For example:
f(t)=[tcos(t)sin(t)]\displaystyle f(t) = \left[ \begin{array}{c} t\cos(t) \\ \sin(t) \end{array} \right]
I talked about how because the output space has more dimensions than the input space, you can get a good feel for the function just by seeing which points in the output space are "hit" by the function as the input t ranges over some set of values.
All the points in the x, y-plane that are hit by the function f, left parenthesis, t, right parenthesis, equals, left parenthesis, t, cosine, left parenthesis, t, right parenthesis, comma, sine, left parenthesis, t, right parenthesis, right parenthesis
When a function is interpreted this way, it is known as a parametric function, and its input t is called the parameter

Two parameters

We can do something very similar with functions that have a two-dimensional input and a three-dimensional output.
f(s,t)=[t3ststs+t]\displaystyle f(s, t) = \left[ \begin{array}{c} t^3 - st \\ s-t \\ s+t \end{array} \right]
Both input coordinates s and t will be known as the parameters, and you are about to see how this function draws a surface in three-dimensional space.
The first step to representing a function like this is to specify a range for the input, such as
0<s<32<t<2\begin{aligned} \quad 0 < &s < 3 \\ -2 < &t < 2 \end{aligned}
Here's what that region looks like in the input space.
Range of input values for parametric surface below
Next, we consider all possible outputs of the function in that range.
Input left parenthesis, s, comma, t, right parenthesisOutput left parenthesis, t, cubed, minus, s, t, comma, s, minus, t, comma, s, plus, t, right parenthesis
left parenthesis, 0, comma, 0, right parenthesisleft parenthesis, 0, comma, 0, comma, 0, right parenthesis
left parenthesis, 1, comma, 0, right parenthesisleft parenthesis, 1, comma, 1, comma, 1, right parenthesis
left parenthesis, 2, comma, 1, right parenthesisleft parenthesis, 6, comma, 1, comma, 3, right parenthesis
\varvdots, rectangle\varvdots, rectangle
Okay, so we don't literally write out all possible outputs, since, you know, that involves infinitely many things. In principle, though, our goal is to represent all those values. Since the function spits out a three-coordinate output, we visualize this output in three-dimensional space.
The following animation shows what it looks like as the points left parenthesis, s, comma, t, right parenthesis in the parameter space move to the corresponding output f, left parenthesis, s, comma, t, right parenthesis in three-dimensional space:
Khan Academy video wrapper
The resulting surface in three-dimensional space is called a parametric surface.
Warning: Surfaces like these can be confused with the graphs of functions that have a two-dimensional input and a one-dimensional output since those are also drawn as surfaces in three-dimensional space. But these parametric functions have a very different flavor. They have a two-dimensional input and a three-dimensional output. Notice, this means graphing them would require five dimensions!

Parameterizing a surface

One of the best ways to get a feel for parametric functions is to start with a surface that you want to describe, then try to find a function that will draw this as a parametric surface. This is also a necessary skill when you start learning about surface integrals later on in multivariable calculus.
Be warned, though, parameterizing surfaces is not easy. In the following example, we will parameterize a torus, the fancy word for the surface of a doughnut. As surfaces go, a torus is a relatively simple example, but it still takes some serious effort.

Example: Parameterize a torus (doughnut)

Torus
Consider the surface pictured above. You can think of it as a doughnut shape, or perhaps just as the glaze on the doughnut, since we don't care about the filling. Our goal right now is to find a function with a two-dimensional input, and a three-dimensional output, such that this doughnut shape is the output.
We imagine "drawing" the surface, although one does not simply draw a surface with a pencil and paper the way we can draw a curve. Instead, our strategy will be to draw each circular slice of the torus. To see what I mean, here is a sample of those circular slices (drawn in blue):
Circle running through the empty portion of the torus
I also drew a large red circle on the x, y-plane running through the centers of each of these slices. This is not part of the torus, but will be a useful reference point for the end goal of drawing each blue slice.
In a real problem, the radius of the red circle might be given to you, as would the radius of each blue circular slice. For now, let's choose arbitrarily that the radius of the red circle is 3, and the radius of each blue slice is 1, with the understanding that choosing different values would give different toruses (torii? torotes?).
Core idea: We will describe each point on the torus as the sum of two vectors:
  1. A vector start bold text, c, end bold text, with, vector, on top from the origin to a point on the red circle. To specify which point on the red circle, we will make this a vector-valued function that depends on a parameter t. As the value of t changes, the point on the red circle described by start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis will change.
  2. A vector start bold text, d, end bold text, with, vector, on top from that point on the red circle to a point on the corresponding "slice" of the torus. The direction this vector points will depend on which point of the red circle it is anchored to, so the value of start bold text, d, end bold text, with, vector, on top should depend on the parameter t used to describe points of the red circle. Furthermore, we will use a second parameter u to determine which part of the blue torus slice start bold text, d, end bold text, with, vector, on top points to.
    Vector left parenthesis, with, \overrightarrow, on top, start bold text, d, end bold text, right parenthesis, left parenthesis, u, comma, t, right parenthesis from the red circle to a point on the torus itself.
This means points on the torus will each be described as a sum.
start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis, plus, start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis
(If you are unfamiliar with the tip-to-tail method of adding vectors, consider reviewing this video).

Why this strategy?

The idea here is that we don't immediately know how to define points on a torus, but we do know how to define circles.
Since the big red circle is flat on the x, y-plane, and has radius 3, we can parameterize it as follows:
c(t)=3[cos(t)sin(t)0]=3cos(t)i^+3sin(t)j^+0k^\begin{aligned} \quad \vec{\textbf{c}}(t) = 3 \left[ \begin{array}{c} \cos(t) \\ \sin(t) \\ 0 \end{array} \right] = 3 \cos(t) \hat{\textbf{i}} + 3 \sin(t) \hat{\textbf{j}} + 0 \hat{\textbf{k}} \end{aligned}
Now, the vector-valued function start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis should also describe a circle, but it's a bit trickier. The (blue) circular slice of the torus we want start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis to draw is at an angle. How do you draw a circle which is sitting at an angle in three-dimensional space?
Well, let's start from what we know. We know that in two dimensions, a unit circle centered at the origin can be described with the parametric function
For our desired blue circular slice, we do something similar, but we exchange start bold text, i, end bold text, with, hat, on top and start bold text, j, end bold text, with, hat, on top for different unit vectors. Take a look at this picture:
Unit vectors which help define the blue circular torus slice.
Instead of the "sideways" direction being start bold text, i, end bold text, with, hat, on top, the unit vector in the x-direction, we think of it as the unit vector pointing away from the origin, which we'll call start bold text, v, end bold text, with, hat, on top. Actually, since that direction might depend on where we start, start bold text, v, end bold text, with, hat, on top should​ be a vector-valued function dependent on the parameter t, so we write it as start bold text, v, end bold text, with, hat, on top, left parenthesis, t, right parenthesis.
Similarly the "upward" direction is no longer start bold text, j, end bold text, with, hat, on top, but start bold text, k, end bold text, with, hat, on top, the unit vector in the z-direction. Therefore, the parameterization of the circular slice should look something like this:
d(u,t)=cos(u)v^(t)+sin(u)k^\begin{aligned} \quad \vec{\textbf{d}}(u, t) = \cos(u) \hat{\textbf{v}}(t) + \sin(u) \hat{\textbf{k}} \end{aligned}
This of course leaves us with a question: What is the formula for start bold text, v, end bold text, with, hat, on top, left parenthesis, t, right parenthesis?
Looking at the picture, the direction away from the origin is also described by start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis, so the formula for start bold text, v, end bold text, with, hat, on top, left parenthesis, t, right parenthesis should be the same as that for start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis, but scaled down to be a unit vector.
c(t)=3[cos(t)sin(t)0]Not a unit vectorv^(t)=[cos(t)sin(t)0]Unit vector\begin{aligned} \quad \vec{\textbf{c}}(t) = 3&\left[\begin{array}{c} \cos(t) \\ \sin(t) \\ 0 \end{array} \right] \quad \leftarrow \small{\gray{\text{Not a unit vector}}} \\ \Downarrow& \\ \hat{\textbf{v}}(t) = &\left[\begin{array}{c} \cos(t) \\ \sin(t) \\ 0 \end{array} \right] \quad \leftarrow \small{\gray{\text{Unit vector}}} \end{aligned}
This means our full expression for start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis is
d(u,t)=cos(u)v^(t)+sin(u)k^=cos(u)[cos(t)sin(t)0]+sin(u)[001]=[cos(u)cos(t)cos(u)sin(t)sin(u)]\begin{aligned} \quad \vec{\textbf{d}}(u, t) &= \cos(u) \hat{\textbf{v}}(t) + \sin(u) \hat{\textbf{k}} \\ &= \cos(u) \left[\begin{array}{c} \cos(t) \\ \sin(t) \\ 0 \end{array} \right]+ \sin(u) \left[\begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right] = \left[\begin{array}{c} \cos(u)\cos(t) \\ \cos(u)\sin(t) \\ \sin(u) \end{array} \right] \end{aligned}

Bring it on home

Remember, the whole reason we defined start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis and start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis was to describe each point on the torus as start bold text, c, end bold text, with, vector, on top, left parenthesis, t, right parenthesis, plus, start bold text, d, end bold text, with, vector, on top, left parenthesis, u, comma, t, right parenthesis. Putting this together, we have the following vector-valued two-parameter function:
f(u,t)=c(t)+d(u,t)=3[cos(t)sin(t)0]+[cos(u)cos(t)cos(u)sin(t)sin(u)]=[3cos(t)+cos(u)cos(t)3sin(t)+cos(u)sin(t)sin(u)]\begin{aligned} \quad \vec{f}(u, t) &= \vec{\textbf{c}}(t) + \vec{\textbf{d}}(u, t) \\ &= 3\left[\begin{array}{c} \cos(t) \\ \sin(t) \\ 0 \end{array} \right] + \left[\begin{array}{c} \cos(u)\cos(t) \\ \cos(u)\sin(t) \\ \sin(u) \end{array} \right] \\ &= \blueE{\left[ \begin{array}{c} 3\cos(t) + \cos(u)\cos(t) \\ 3\sin(t)+\cos(u)\sin(t) \\ \sin(u) \end{array} \right]} \end{aligned}
As u ranges from 0 to 2, pi, the output of this function f, with, vector, on top, left parenthesis, u, comma, t, right parenthesis will trace one of the blue slices, and as t ranges from 0 to 2, pi, the slices themselves will trace out the entire torus.
Here's what it might look like if we take the points from the parameter space where 0, is less than or equal to, u, is less than or equal to, 2, pi and 0, is less than or equal to, t, is less than or equal to, 2, pi, and watch them move to the output of our function f, with, vector, on top, left parenthesis, u, comma, t, right parenthesis:
Khan Academy video wrapper

Summary

  • You can visualize a function with a two-dimensional input and a three-dimensional output by plotting all the output points corresponding to some region of the input space. This results in a surface, known as a parametric surface.
  • The process of going the other way around, starting with a surface in space and trying to find a function that "draws" this surface, is known as parameterizing the surface. In general, this is a tricky thing to do.

Want to join the conversation?

  • blobby green style avatar for user Priyanka Thatipamala
    The first example in this article gives f(s,t) = (t^3-st+2,...) but when parameterized gives x = t^3 - st. Shouldn't it be x = t^3 - st + 2 ?
    (23 votes)
    Default Khan Academy avatar avatar for user
  • piceratops sapling style avatar for user Ronald Modesitt
    I really enjoyed this discussion of functions. Can you recommend a textbook that provides a similar discussion of functions. My Vector Calc book barely touches the subject in the same manner.
    (8 votes)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user klr5240
    I am totally lost on why:
    t cannot equal u?
    v(t) is not multiplied by both cos(u) and sin(u)?
    why we need v(t)?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Yerboi
      t is allowed to equal u, but they aren’t the same variable. They vary independently. Suppose t ∈ [0, 2π] and u ∈ [0, 2π] as well. For every value of t, u can sweep out values from 0 to 2π. This includes inputs (t, u) such as (π, π), (0, 2π) and so on.

      To answer your 3rd question next, v̂(t) is necessary so the small circles “turn” with c⃗(t). If c⃗(t) is at coords (0, 3, 0), which is t = π / 2, then the circle d⃗(u, t) sweeps out should be in the same plane as c⃗(t) and k̂. For example, the xy plane cuts the circle at c⃗(t) = (0, 3, 0) but not at (3, 0, 0). v̂(t) is the unit vector (vector with magnitude 1) that points along c⃗(t).

      As such, there’s a plane that’s formed by the unit vectors v̂(t) and k̂. v̂(t) is just the “x-coord” and k̂ is the “y-coord”. Then, the circle in this plane would be cos(u)v̂(t) + sin(u)k̂, which just so happens to be d⃗(u, t). v̂(t) is multiplied by cos(u) because it represents the “x-component” while sin(u) represents the “y-component”.

      Hope this helps!
      (3 votes)
  • blobby green style avatar for user Sunny Chen
    Why is the input range 0<s<3 and -2<t<2 in the first example?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • old spice man green style avatar for user Petar Bulovic
    Why do I get a funny looking picture when I set u=t? They seem to take on same values.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • purple pi purple style avatar for user Avi Bank
    (2 votes)
    Default Khan Academy avatar avatar for user
  • duskpin tree style avatar for user Marilyn Barragán Castañeda
    why this article says that the unit vector of 3cos(t)i+3sin(t)j+0k is just cos(t)i+sin(t)j , it would not be the vector itself over its magnitude?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Still No Sheep
      Because the unit vector must have a magnitude (here: the radius of the circle it describes) of just one unit. The vector 3cos(t)i+3sin(t)j+0k has a magnitude of 3 and describes a circle of radius 3 so it has to be scaled down by a factor of 2/3 (from 3 to 1) to produce a unit vector.
      (1 vote)
  • leaf green style avatar for user sandyb4u4ever
    In the first video,can the input space and the surface be represented on the same graph for a better appreciation of input and output spaces interactions...
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user msaisashank
    May I know the software that is being used by you for showcasing different models and graphs in 3d just by tweaking some values and choosing some functionalities. Thank you in advance.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user klr5240
    I still don't get why u cannot equal t?
    Also why wouldn't both v and k be functions of (t)?
    (1 vote)
    Default Khan Academy avatar avatar for user