Tutorials › Calculus III › Joining Curves with Piecewise Parametrizations

Representing Space Curves · Tutorial 123 of 999

Joining Curves with Piecewise Parametrizations

Build a single piecewise parametrization for consecutive curve pieces by assigning intervals and matching the formulas at every shared endpoint.

Beginner 9 min read

What You'll Learn

  • Define a piecewise parametrization on consecutive parameter intervals
  • Check that adjacent formulas give the same vector at their shared parameter
  • Rescale a local parameter to fit a chosen interval
  • Join line segments and curved pieces into one ordered path
  • Detect and correct a mismatched endpoint in a piecewise definition

Why Join Curve Pieces?

A path may be made from several simple pieces rather than one formula. A route through three points, for example, can be described by two line segments. Another path might follow a line and then bend along an arc. To describe the whole route with one vector-valued function, assign each piece its own part of a parameter interval and make sure consecutive pieces meet at the same point.

The formulas on separate intervals need not be identical. What matters at a join is that the endpoint of one piece is the starting point of the next. This lets the pieces describe one ordered path without a gap between them.

Key idea: A piecewise parametrization uses a different formula on each of several consecutive parameter intervals. At each shared parameter, the adjacent formulas must give the same vector.

Definition and Endpoint Condition

Choose parameter values \(t_0<t_1<\cdots<t_n\). For each interval \([t_{i-1},t_i]\), let \(\mathbf r_i\) be a vector-valued function describing one curve piece. The combined path uses \(\mathbf r_i(t)\) on that interval.

$$ \mathbf r(t)= \begin{cases} \mathbf r_1(t), & t_0\le t\le t_1,\\ \mathbf r_2(t), & t_1\le t\le t_2,\\ \vdots\\ \mathbf r_n(t), & t_{n-1}\le t\le t_n. \end{cases} $$

Writing both adjacent intervals as closed intervals means that the formulas are both applicable at a shared parameter \(t_i\). To define one unambiguous vector there, require them to agree:

$$ \mathbf r_i(t_i)=\mathbf r_{i+1}(t_i), \qquad i=1,\ldots,n-1. $$

This is the endpoint matching condition. It says that the ending point of piece \(i\) is the starting point of piece \(i+1\). If each individual formula traces its intended piece in the intended direction, matching every adjacent pair produces a single ordered path made of those pieces.

Sometimes the formulas for the pieces are initially written using separate local parameters, such as \(u\in[0,1]\). Before using them in a single piecewise function, convert each local parameter to the chosen global parameter \(t\). An affine change of parameter does this while preserving the order of travel.

Rescaling a Piece to Its Assigned Interval

Suppose a curve piece is described locally by \(\boldsymbol\gamma(u)\), where \(0\le u\le1\). To place it on the global interval \(a\le t\le b\), use the affine parameter

$$ u=\frac{t-a}{b-a}. $$

Indeed, at \(t=a\), this gives \(u=0\), and at \(t=b\), it gives \(u=1\). Thus the piece starts and ends at the same points as the local formula. Its global-parameter expression is \(\boldsymbol\gamma\!\left(\frac{t-a}{b-a}\right)\).

Why this works: Since \(b-a>0\), the affine expression increases from \(0\) to \(1\) as \(t\) increases from \(a\) to \(b\). Substitution therefore traverses the local curve from its initial point to its final point, with the endpoints assigned to \(a\) and \(b\).

For a line segment from \(\mathbf A\) to \(\mathbf B\), the local formula is \(\mathbf A+u(\mathbf B-\mathbf A)\). Rescaling it to \([a,b]\) gives

$$ \mathbf A+\frac{t-a}{b-a}(\mathbf B-\mathbf A). $$

At \(t=a\), the fraction is \(0\), so the value is \(\mathbf A\). At \(t=b\), the fraction is \(1\), so the value is \(\mathbf A+(\mathbf B-\mathbf A)=\mathbf B\). This endpoint check is useful whenever a segment is one piece of a larger path.

Worked Example: Two Consecutive Line Segments

Worked Example: Two Consecutive Line Segments

Join \(\mathbf A=(0,0,0)\) to \(\mathbf B=(2,1,0)\), then join \(\mathbf B\) to \(\mathbf C=(2,1,3)\). Use the parameter interval \([0,3]\), assigning \([0,1]\) to the first segment and \([1,3]\) to the second.

For the first segment, the interval has length \(1\). Its direction vector is

$$ \mathbf B-\mathbf A=(2-0,1-0,0-0)=(2,1,0). $$

Thus, on \(0\le t\le1\), use \(\mathbf A+t(\mathbf B-\mathbf A)\), or

$$ \mathbf r_1(t)=(0,0,0)+t(2,1,0)=(2t,t,0). $$

For the second segment, the interval starts at \(t=1\) and has length \(3-1=2\). Its direction vector is

$$ \mathbf C-\mathbf B=(2-2,1-1,3-0)=(0,0,3). $$

The fraction of the way along this segment is \((t-1)/2\), so

$$ \mathbf r_2(t)=\mathbf B+\frac{t-1}{2}(\mathbf C-\mathbf B) =(2,1,0)+\frac{t-1}{2}(0,0,3) =\left(2,1,\frac{3(t-1)}{2}\right). $$

The combined parametrization is

$$ \mathbf r(t)= \begin{cases} (2t,t,0), & 0\le t\le1,\\ \left(2,1,\frac{3(t-1)}{2}\right), & 1\le t\le3. \end{cases} $$

Check the first piece at its start and end:

$$ \mathbf r_1(0)=(0,0,0)=\mathbf A, \qquad \mathbf r_1(1)=(2,1,0)=\mathbf B. $$

Check the second piece at its start and end:

$$ \mathbf r_2(1)=\left(2,1,\frac{3(1-1)}{2}\right)=(2,1,0)=\mathbf B, $$
$$ \mathbf r_2(3)=\left(2,1,\frac{3(3-1)}{2}\right) =\left(2,1,\frac{6}{2}\right)=(2,1,3)=\mathbf C. $$

Both formulas give \(\mathbf B\) at \(t=1\), so the join matches. The path starts at \(\mathbf A\), reaches \(\mathbf B\), and ends at \(\mathbf C\).

Worked Example: A Line Followed by a Circular Arc

Worked Example: A Line Followed by a Circular Arc

Start at \((-1,0,0)\), travel along the \(x\)-axis to \((1,0,0)\), then follow a quarter-circle in the \(xy\)-plane to \((0,1,0)\). Assign the line to \(0\le t\le1\) and the arc to \(1\le t\le2\).

The line’s displacement is \((1,0,0)-(-1,0,0)=(2,0,0)\). Therefore its parametrization on the first interval is

$$ \mathbf r_1(t)=(-1,0,0)+t(2,0,0)=(-1+2t,0,0). $$

A unit circle in the \(xy\)-plane can be parametrized by \((\cos\theta,\sin\theta,0)\). For the desired quarter-circle, the angle must increase from \(0\) to \(\pi/2\). On \(1\le t\le2\), the affine angle \(\theta=\frac{\pi}{2}(t-1)\) has those endpoint values. Hence

$$ \mathbf r_2(t)= \left( \cos\left(\frac{\pi}{2}(t-1)\right), \sin\left(\frac{\pi}{2}(t-1)\right), 0 \right). $$

Together, the pieces are

$$ \mathbf r(t)= \begin{cases} (-1+2t,0,0), & 0\le t\le1,\\ \left(\cos\left(\frac{\pi}{2}(t-1)\right), \sin\left(\frac{\pi}{2}(t-1)\right),0\right), & 1\le t\le2. \end{cases} $$

At the start of the line, \(\mathbf r_1(0)=(-1+0,0,0)=(-1,0,0)\). At its end, \(\mathbf r_1(1)=(-1+2,0,0)=(1,0,0)\). For the arc, \(t=1\) gives angle \(\frac{\pi}{2}(1-1)=0\), so \(\mathbf r_2(1)=(\cos0,\sin0,0)=(1,0,0)\). At \(t=2\), the angle is \(\frac{\pi}{2}(2-1)=\frac{\pi}{2}\), so \(\mathbf r_2(2)=(\cos(\pi/2),\sin(\pi/2),0)=(0,1,0)\).

The two formulas agree at \(t=1\), at the point \((1,0,0)\). Thus the line ends exactly where the circular arc begins.

Worked Example: A Parabolic Piece Followed by a Segment

Worked Example: A Parabolic Piece Followed by a Segment

Let the first piece be \(\boldsymbol\gamma(u)=(u,u^2,0)\) for \(0\le u\le1\). It starts at \((0,0,0)\) and ends at \((1,1,0)\). Follow it with a line segment from \((1,1,0)\) to \((2,0,1)\). Use \([0,1]\) for the curve and \([1,3]\) for the segment.

The first piece already has the desired parameter interval, so set \(\mathbf r_1(t)=(t,t^2,0)\). For the segment, the displacement is

$$ (2,0,1)-(1,1,0)=(1,-1,1). $$

The second interval has length \(3-1=2\), so the fraction of the segment traversed at parameter \(t\) is \((t-1)/2\). Therefore

$$ \mathbf r_2(t)=(1,1,0)+\frac{t-1}{2}(1,-1,1) =\left(1+\frac{t-1}{2},1-\frac{t-1}{2},\frac{t-1}{2}\right). $$

The full path is

$$ \mathbf r(t)= \begin{cases} (t,t^2,0), & 0\le t\le1,\\ \left(1+\frac{t-1}{2},1-\frac{t-1}{2},\frac{t-1}{2}\right), & 1\le t\le3. \end{cases} $$

At \(t=0\), the first formula gives \((0,0,0)\). At \(t=1\), it gives \((1,1,0)\). The second formula at \(t=1\) gives \((1+0,1-0,0)=(1,1,0)\), matching the first piece. At \(t=3\), the fraction is \((3-1)/2=1\), and the second formula gives \((1+1,1-1,1)=(2,0,1)\). The endpoint and join checks confirm the intended route.

A Reliable Construction Process

For a path with several pieces, carry out the same checks in order. In particular, do not choose formulas only by visual appearance: evaluate each formula at the parameter values where its piece begins and ends.

1
List the path’s vertices and pieces.
Write down the points where the path starts, ends, or changes from one curve piece to another, in travel order.
2
Assign consecutive intervals.
Choose breakpoints \(t_0<t_1<\cdots<t_n\), with one interval for each piece.
3
Write each piece using the global parameter.
Rescale any local parameter so that the piece’s initial and final points correspond to its assigned interval endpoints.
4
Check all endpoints and joins.
Evaluate each formula at both ends of its interval, then verify that adjacent formulas agree at every shared parameter.

Common Pitfall: Forgetting to Shift the Parameter

When a segment begins at \(t=a\), its progress along the segment must be zero at \(t=a\). The factor for an interval \([a,b]\) is \((t-a)/(b-a)\), not \(t/(b-a)\) unless \(a=0\).

For example, in the first worked example, the second segment runs from \((2,1,0)\) to \((2,1,3)\) on \([1,3]\). Using the incorrect factor \(t/2\) would give, at the joining parameter \(t=1\),

$$ (2,1,0)+\frac{1}{2}(0,0,3) =\left(2,1,\frac{3}{2}\right), $$

which is not the required joining point \((2,1,0)\). The correct factor is \((t-1)/2\); at \(t=1\) it is \(0\), so the second piece starts at \((2,1,0)\), as required.

Check before accepting a piecewise parametrization: Evaluate every piece at its interval endpoints. At each join, the two endpoint vectors must be equal. A formula that traces the right-looking curve can still start at the wrong point if its parameter interval has not been accounted for.

Why Endpoint Matching Matters

Each piece describes only part of the route. The endpoint condition connects the pieces in the stated order: the first piece ends where the second begins, the second ends where the third begins, and so on. Consequently, the value assigned at a shared parameter is consistent, and the path has no gap at that join.

Endpoint matching does not require adjacent formulas to have the same direction of travel or the same rate of traversal. It requires only that their values agree at the shared parameter. The formulas may describe quite different types of curves, as the line-and-arc example shows. For constructing the path, keep the two tasks distinct: first make each formula trace its intended piece, then verify the endpoint equations that join those pieces.

Check Your Understanding

Use endpoint evaluations to check your reasoning.

  1. For a local curve \(\boldsymbol\gamma(u)\), \(0\le u\le1\), what expression for \(u\) places it on the interval \([a,b]\)?
  2. A piece ends at \((3,0,1)\) when \(t=2\), and the next piece begins at \(t=2\). What endpoint equation must hold for the next piece?
  3. Write a parametrization of the segment from \((0,1,0)\) to \((2,1,2)\) on \(4\le t\le6\), then check both endpoints.
  4. Why does the expression \(t/(b-a)\) generally fail to rescale a piece onto an interval \([a,b]\) when \(a\ne0\)?
  5. Can two different formulas be used on adjacent intervals if they give the same vector at the shared parameter? Explain.