TExcelTAD
Home › Calculus in Depth › Vector Functions and Space Curves

Vector Functions and Space Curves

A vector function takes a number tt and returns a vector. Feed it every tt in an interval and the tips of the output vectors trace a curve in space. This lesson defines vector functions precisely, shows that limits and continuity work one component at a time, and practises turning geometric descriptions into parametrisations, the skill behind every camera path, projectile and spline in software.

For a gentler first look at curves given by parameters, see Parametric Curves; the plane version with calculus is in Curves Defined by Parametric Equations.

Definition

A vector-valued function (vector function) is a rule r\mathbf{r} that assigns to each tt in a domain D⊆RD \subseteq \mathbb{R} a vector in R3\mathbb{R}^3:

r(t)=⟨f(t),g(t),h(t)⟩=f(t) i+g(t) j+h(t) k\mathbf{r}(t) = \langle f(t), g(t), h(t) \rangle = f(t)\,\mathbf{i} + g(t)\,\mathbf{j} + h(t)\,\mathbf{k}

ff, gg and hh are the component functions. Unless a domain is stated, DD is the set of tt for which all three components are defined, that is, the intersection of their domains.

Example: r(t)=⟨t+1,ln⁡(3−t),t2⟩\mathbf{r}(t) = \langle \sqrt{t + 1}, \ln(3 - t), t^2 \rangle needs t≥−1t \ge -1 (square root) and t<3t < 3 (logarithm), so D=[−1,3)D = [-1, 3).

Limits and continuity

The limit of a vector function is defined by components:

lim⁡t→ar(t)=⟨lim⁡t→af(t),lim⁡t→ag(t),lim⁡t→ah(t)⟩\lim_{t \to a} \mathbf{r}(t) = \left\langle \lim_{t \to a} f(t), \lim_{t \to a} g(t), \lim_{t \to a} h(t) \right\rangle

provided the three component limits exist. This is not an arbitrary convention. The ε\varepsilon-definition "∥r(t)−L∥<ε\lVert \mathbf{r}(t) - \mathbf{L} \rVert < \varepsilon whenever 0<∣t−a∣<δ0 < \lvert t - a \rvert < \delta" is equivalent to it, because for any vector w=⟨w1,w2,w3⟩\mathbf{w} = \langle w_1, w_2, w_3 \rangle

∣wi∣≤∥w∥≤∣w1∣+∣w2∣+∣w3∣\lvert w_i \rvert \le \lVert \mathbf{w} \rVert \le \lvert w_1 \rvert + \lvert w_2 \rvert + \lvert w_3 \rvert

The left inequality shows that if r→L\mathbf{r} \to \mathbf{L} in length then each component converges; the right one shows that if every component converges then the length of the error goes to 0. So all the scalar limit laws carry over: the limit of a sum is the sum of limits, the limit of a dot product is the dot product of the limits, and so on.

r\mathbf{r} is continuous at aa if lim⁡r(t)=r(a)\lim \mathbf{r}(t) = \mathbf{r}(a) as t→at \to a, which happens exactly when ff, gg and hh are all continuous at aa.

python · try it yourself
import sympy as sp

t = sp.symbols("t")
r = sp.Matrix([sp.sin(2*t) / t, (1 - sp.cos(t)) / t**2, t * sp.log(t)])

L = r.applyfunc(lambda c: sp.limit(c, t, 0, "+"))
print("limit as t -> 0+:", list(L))

# numerical check: the distance to L shrinks with t
for h in [0.1, 0.01, 0.001]:
    v = [float(c.subs(t, h)) for c in r]
    err = sum((vi - float(Li))**2 for vi, Li in zip(v, L)) ** 0.5
    print(f"t = {h:<6} r(t) = [{v[0]:.5f}, {v[1]:.5f}, {v[2]:.5f}]  |r - L| = {err:.5f}")
limit as t -> 0+: [2, 1/2, 0]
t = 0.1    r(t) = [1.98669, 0.49958, -0.23026]  |r - L| = 0.23064
t = 0.01   r(t) = [1.99987, 0.50000, -0.04605]  |r - L| = 0.04605
t = 0.001  r(t) = [2.00000, 0.50000, -0.00691]  |r - L| = 0.00691

The third component tln⁡tt \ln t goes to 0 slowly (like tln⁡tt \ln t, not like tt), and it dominates the error. Defining r(0)=⟨2,1/2,0⟩\mathbf{r}(0) = \langle 2, 1/2, 0 \rangle would make this r\mathbf{r} continuous from the right at 0.

Space curves

If r\mathbf{r} is continuous on an interval II, the set CC of points (f(t),g(t),h(t))(f(t), g(t), h(t)) for t∈It \in I is a space curve, and the equations x=f(t)x = f(t), y=g(t)y = g(t), z=h(t)z = h(t) are parametric equations of CC. The vector r(t)\mathbf{r}(t) is the position vector of the point on CC at parameter tt.

Two facts to keep apart:

  • A curve is a set of points. The same curve has infinitely many parametrisations: ⟨cos⁡t,sin⁡t,0⟩\langle \cos t, \sin t, 0 \rangle and ⟨cos⁡2t,sin⁡2t,0⟩\langle \cos 2t, \sin 2t, 0 \rangle for t∈[0,π]t \in [0, \pi] both give the unit circle (the second goes round once, the first only halfway). Speed, direction and starting point differ.
  • A parametrisation carries timing. Two particles can move along paths that cross without ever colliding, because they reach the crossing at different times.
Curve Vector function Shape
line through P0P_0 with direction v\mathbf{v} P0+tvP_0 + t\mathbf{v} straight line
circular helix ⟨acos⁡t,asin⁡t,ct⟩\langle a\cos t, a\sin t, ct \rangle winds around the cylinder x2+y2=a2x^2 + y^2 = a^2, rising 2πc2\pi c per turn
conical spiral ⟨tcos⁡t,tsin⁡t,t⟩\langle t\cos t, t\sin t, t \rangle lies on the cone z2=x2+y2z^2 = x^2 + y^2
twisted cubic ⟨t,t2,t3⟩\langle t, t^2, t^3 \rangle crosses every plane at most three times
torus knot ⟨(2+cos⁡qt)cos⁡pt,(2+cos⁡qt)sin⁡pt,sin⁡qt⟩\langle (2 + \cos qt)\cos pt, (2 + \cos qt)\sin pt, \sin qt \rangle winds pp times around the axis, qq times through the hole

To check that a curve lies on a surface, substitute: for the conical spiral, x2+y2=t2(cos⁡2t+sin⁡2t)=t2=z2x^2 + y^2 = t^2(\cos^2 t + \sin^2 t) = t^2 = z^2.

Curves as intersections of surfaces

A common task is to parametrise the curve where two surfaces meet. The strategy is to parametrise the surface that is easiest (often a cylinder), then solve the other equation for the remaining coordinate.

Intersection of the cylinder x2+y2=4x^2 + y^2 = 4 and the surface z=xyz = xy:

x=2cos⁡t,y=2sin⁡t(satisfies the cylinder)z=xy=4cos⁡tsin⁡t=2sin⁡2t(satisfies z=xy)r(t)=⟨2cos⁡t,2sin⁡t,2sin⁡2t⟩,0≤t≤2π\begin{aligned} x &= 2\cos t, \quad y = 2\sin t && \text{(satisfies the cylinder)} \\ z &= xy = 4\cos t \sin t = 2\sin 2t && \text{(satisfies } z = xy\text{)} \\ \mathbf{r}(t) &= \langle 2\cos t, 2\sin t, 2\sin 2t \rangle, \quad 0 \le t \le 2\pi \end{aligned}

The curve goes up and down twice per trip around the cylinder, like the edge of a saddle-shaped potato crisp.

python · try it yourself
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 2 * np.pi, 400)
x, y, z = 2 * np.cos(t), 2 * np.sin(t), 2 * np.sin(2 * t)

print("max |x^2 + y^2 - 4| :", float(np.max(np.abs(x**2 + y**2 - 4))))
print("max |z - x*y|       :", float(np.max(np.abs(z - x * y))))
print("highest point at t =", round(float(t[np.argmax(z)]), 3), "z =", round(float(z.max()), 3))

ax = plt.figure(figsize=(6, 4)).add_subplot(projection="3d")
ax.plot(x, y, z, color="crimson", lw=2)
ax.set_title("x² + y² = 4  meets  z = xy")
ax.set_xlabel("x"); ax.set_ylabel("y"); ax.set_zlabel("z")
max |x^2 + y^2 - 4| : 8.881784197001252e-16
max |z - x*y|       : 4.440892098500626e-16
highest point at t = 0.787 z = 2.0

The residuals are at the level of floating-point rounding, which confirms the parametrisation; the peak is at t≈π/4t \approx \pi/4, where sin⁡2t=1\sin 2t = 1.

Intersection versus collision

Paths r1\mathbf{r}_1 and r2\mathbf{r}_2 intersect where r1(t)=r2(s)\mathbf{r}_1(t) = \mathbf{r}_2(s) for some tt and ss; the particles collide only if r1(t)=r2(t)\mathbf{r}_1(t) = \mathbf{r}_2(t) for the same tt. Solving these systems symbolically is routine:

python · try it yourself
import sympy as sp

t, s = sp.symbols("t s", real=True)
r1 = sp.Matrix([t, 2 - t, t**2])          # particle A
r2 = sp.Matrix([2*s, s, 4 - 2*s])          # particle B

print("path crossings (t, s):", sp.solve(list(r1 - r2), [t, s], dict=True))
print("collisions (same t)  :", sp.solve(list(r1 - r2.subs(s, t)), [t], dict=True))
print("A at t = 4/3         :", list(r1.subs(t, sp.Rational(4, 3))))
path crossings (t, s): []
collisions (same t)  : []
A at t = 4/3         : [4/3, 2/3, 16/9]

Neither system has a solution. From the first two components t=2st = 2s and 2−t=s2 - t = s, so s=2/3s = 2/3 and t=4/3t = 4/3, but then the zz-components are 16/916/9 and 8/38/3, which differ. The paths pass over each other (the third line just shows where A is at t=4/3t = 4/3). In 3D, two random curves almost never meet: that is why collision detection tests closest distance, not exact equality.

In software

  • Animation and camera paths. A keyframed camera is a vector function of time, usually a piecewise polynomial such as a Bézier curve or a Catmull-Rom spline. Continuity of r\mathbf{r} (no jumps) is the minimum; the next lessons demand continuous derivatives too.
  • Projectiles and particles. Every particle in an effects system has a position r(t)\mathbf{r}(t), often in closed form (r0+v0t+12gt2\mathbf{r}_0 + \mathbf{v}_0 t + \frac{1}{2}\mathbf{g}t^2) so it can be evaluated at any frame without stepping.
  • Procedural geometry. Tubes, cables, roads and roller-coaster tracks are generated by sweeping a cross-section along a space curve. Helices give springs and screw threads; torus knots are a classic shader and 3D-printing demo.
  • Collision of moving objects. Continuous collision detection asks whether r1(t)−r2(t)\mathbf{r}_1(t) - \mathbf{r}_2(t) gets shorter than the sum of radii for some tt in a frame, the "same tt" condition above with a tolerance.

Exercises

Exercise 1: Domain

Find the domain of r(t)=⟨9−t2,ln⁡(t+1),1/(t−2)⟩\mathbf{r}(t) = \langle \sqrt{9 - t^2}, \ln(t + 1), 1/(t - 2) \rangle.

Answer

D=(−1,2)∪(2,3]D = (-1, 2) \cup (2, 3].

Solution
9−t2needs −3≤t≤3ln⁡(t+1)needs t>−11/(t−2)needs t≠2intersection:−1<t≤3, t≠2→(−1,2)∪(2,3]\begin{aligned} &\sqrt{9 - t^2} && \text{needs } -3 \le t \le 3 \\ &\ln(t + 1) && \text{needs } t > -1 \\ &1/(t - 2) && \text{needs } t \ne 2 \\ &\text{intersection:} && -1 < t \le 3,\ t \ne 2 \quad\to\quad (-1, 2) \cup (2, 3] \end{aligned}

Exercise 2: A limit

Compute lim⁡⟨(e3t−1)/t,t2ln⁡∣t∣,tan⁡t/t⟩\lim \langle (e^{3t} - 1)/t, t^2 \ln\lvert t \rvert, \tan t / t \rangle as t→0t \to 0.

Answer

⟨3,0,1⟩\langle 3, 0, 1 \rangle.

Solution

Component by component: (e3t−1)/t→3(e^{3t} - 1)/t \to 3 (it is the derivative of e3te^{3t} at 0, or use l'Hospital's rule); t2ln⁡∣t∣→0t^2 \ln\lvert t \rvert \to 0 because tln⁡∣t∣→0t \ln\lvert t \rvert \to 0 and the extra factor t→0t \to 0; tan⁡t/t=(sin⁡t/t)⋅(1/cos⁡t)→1⋅1=1\tan t / t = (\sin t / t) \cdot (1/\cos t) \to 1 \cdot 1 = 1.

python · try it yourself
import sympy as sp
t = sp.symbols("t")
print([sp.limit(c, t, 0) for c in [(sp.exp(3*t) - 1)/t, t**2*sp.log(sp.Abs(t)), sp.tan(t)/t]])
[3, 0, 1]

Exercise 3: Cylinder meets plane

Find a vector function for the curve where the cylinder x2+y2=9x^2 + y^2 = 9 meets the plane x+z=2x + z = 2.

Answer

r(t)=⟨3cos⁡t,3sin⁡t,2−3cos⁡t⟩\mathbf{r}(t) = \langle 3\cos t, 3\sin t, 2 - 3\cos t \rangle, 0≤t≤2π0 \le t \le 2\pi (an ellipse).

Solution

Parametrise the cylinder with x=3cos⁡tx = 3\cos t, y=3sin⁡ty = 3\sin t. The plane gives z=2−x=2−3cos⁡tz = 2 - x = 2 - 3\cos t. The curve is a plane section of a cylinder, so it is an ellipse, tilted at 45°.

Exercise 4: Do they collide? (code)

Particle A moves on r1(t)=⟨t,t2,t3⟩\mathbf{r}_1(t) = \langle t, t^2, t^3 \rangle and particle B on r2(t)=⟨1+t,1+3t,1−t⟩\mathbf{r}_2(t) = \langle 1 + t, 1 + 3t, 1 - t \rangle. Do their paths cross? Do they collide? Use SymPy.

Answer

The paths cross only at (1,1,1)(1, 1, 1), reached by A at t=1t = 1 and by B at t=0t = 0. They never collide.

Solution

Crossing: t=1+st = 1 + s, t2=1+3st^2 = 1 + 3s, t3=1−st^3 = 1 - s. The first gives s=t−1s = t - 1, then t2=3t−2t^2 = 3t - 2, so t=1t = 1 or t=2t = 2. t=1t = 1 (s=0s = 0) satisfies the third equation; t=2t = 2 (s=1s = 1) gives 8≠08 \ne 0. Collision would need t=1+tt = 1 + t, impossible.

python · try it yourself
import sympy as sp
t, s = sp.symbols("t s")
r1 = sp.Matrix([t, t**2, t**3])
r2 = sp.Matrix([1 + s, 1 + 3*s, 1 - s])
print("crossings:", sp.solve(list(r1 - r2), [t, s], dict=True))
print("collisions:", sp.solve(list(r1 - r2.subs(s, t)), t))
crossings: [{s: 0, t: 1}]
collisions: []

Exercise 5: Which surface?

Show that the curve r(t)=⟨sin⁡tcos⁡5t,sin⁡tsin⁡5t,cos⁡t⟩\mathbf{r}(t) = \langle \sin t \cos 5t, \sin t \sin 5t, \cos t \rangle lies on a sphere, and name the sphere.

Answer

It lies on the unit sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1.

Solution
x2+y2=sin⁡2t (cos⁡25t+sin⁡25t)=sin⁡2tx2+y2+z2=sin⁡2t+cos⁡2t=1\begin{aligned} x^2 + y^2 &= \sin^2 t\,(\cos^2 5t + \sin^2 5t) = \sin^2 t \\ x^2 + y^2 + z^2 &= \sin^2 t + \cos^2 t = 1 \end{aligned}

As tt goes from 0 to π\pi the point moves from the north pole to the south pole while circling the zz-axis five times: a spherical spiral.

Test yourself

When is a vector function r(t)=⟨f(t),g(t),h(t)⟩\mathbf{r}(t) = \langle f(t), g(t), h(t) \rangle continuous at t=at = a?

  1. When at least one component is continuous at aa
  2. When ∥r(t)∥\lVert \mathbf{r}(t) \rVert is continuous at aa
  3. Exactly when ff, gg and hh are all continuous at aa
  4. When r(a)≠0\mathbf{r}(a) \ne \mathbf{0}

Particles on r1\mathbf{r}_1 and r2\mathbf{r}_2 collide when…

  1. r1(t)=r2(t)\mathbf{r}_1(t) = \mathbf{r}_2(t) for some single value tt
  2. r1(t)=r2(s)\mathbf{r}_1(t) = \mathbf{r}_2(s) for some tt and ss
  3. their paths lie on the same surface
  4. r1′(t)=r2′(t)\mathbf{r}_1'(t) = \mathbf{r}_2'(t)

Which surface contains the curve ⟨tcos⁡t,tsin⁡t,t⟩\langle t\cos t, t\sin t, t \rangle?

  1. The sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1
  2. The cone z2=x2+y2z^2 = x^2 + y^2
  3. The cylinder x2+y2=1x^2 + y^2 = 1
  4. The plane z=x+yz = x + y