Tutorials › Calculus III › Parametrizing Line Segments and Rays

Representing Space Curves · Tutorial 110 of 999

Parametrizing Line Segments and Rays

Use parameter intervals to control which part of a line is traced and whether its endpoints are included.

Beginner 9 min read

What You'll Learn

  • Write a line parametrization using a starting point and a nonzero direction vector.
  • Choose the parameter interval that produces a segment, ray, or entire line.
  • Identify which endpoint is included or excluded by an interval.
  • Reverse a ray’s direction by changing its starting point and direction vector.
  • Check a proposed parametrization by evaluating its endpoints and sample parameter values.

One Line, Several Possible Traces

A line parametrization gives a point on a line for each allowed parameter value. The formula determines the line’s direction and position; the parameter interval determines which part of that line is traced. Restricting the parameter can produce only the portion between two points, or the portion starting at one point and continuing without bound.

Endpoint inclusion matters. A closed segment contains both of its endpoints, while an open endpoint is left out. A ray includes its starting point when its parameter begins at zero, but a ray with a strictly positive parameter does not include that point.

Key idea: For a line parametrization \(\mathbf{r}(t)=\mathbf{P}+t\mathbf{d}\), with nonzero direction vector \(\mathbf{d}\), changing the allowed values of \(t\) changes the traced set without changing the underlying line.

From a Line Parametrization to a Segment or Ray

Let \(\mathbf{P}\) and \(\mathbf{Q}\) be distinct points in space, and set \(\mathbf{d}=\mathbf{Q}-\mathbf{P}\). The parametrization

$$ \mathbf{r}(t)=\mathbf{P}+t(\mathbf{Q}-\mathbf{P}) $$

passes through \(\mathbf{P}\) at \(t=0\) and \(\mathbf{Q}\) at \(t=1\). Values of \(t\) between zero and one give the points between them; values outside that interval continue along the same line.

Definition: The closed line segment from \(\mathbf{P}\) to \(\mathbf{Q}\) is the set of points \(\mathbf{P}+t(\mathbf{Q}-\mathbf{P})\) for \(0\leq t\leq1\). The ray starting at \(\mathbf{P}\) in the direction of \(\mathbf{Q}-\mathbf{P}\) is the set of points \(\mathbf{P}+t(\mathbf{Q}-\mathbf{P})\) for \(t\geq0\). Allowing every real value of \(t\) gives the entire line through \(\mathbf{P}\) and \(\mathbf{Q}\).

The brackets in an interval communicate endpoint inclusion: \([0,1]\) includes both zero and one, while \((0,1)\) excludes both. A mixed interval such as \([0,1)\) includes zero but excludes one. The parameter values translate directly into points on the line: \(t=0\) gives \(\mathbf{P}\), and \(t=1\) gives \(\mathbf{Q}\).

Why the Intervals Produce These Sets

The relationship follows by rewriting the line formula:

$$ \mathbf{P}+t(\mathbf{Q}-\mathbf{P}) =(1-t)\mathbf{P}+t\mathbf{Q}. $$

When \(0\leq t\leq1\), the two coefficients \(1-t\) and \(t\) are nonnegative and sum to one. Thus the point is a weighted combination of the endpoints, moving from \(\mathbf{P}\) at \(t=0\) to \(\mathbf{Q}\) at \(t=1\). As \(t\) varies through the full interval, it traces the segment. Including the interval endpoints includes both points; excluding one of those parameter values removes the corresponding endpoint.

When \(t\geq0\), the formula starts at \(\mathbf{P}\) and moves in the direction \(\mathbf{Q}-\mathbf{P}\). At \(t=1\), it reaches \(\mathbf{Q}\); for \(t>1\), it continues beyond \(\mathbf{Q}\). This gives a ray. When \(t\) can be any real number, positive values move in the direction of \(\mathbf{Q}-\mathbf{P}\), and negative values move in the opposite direction. Together these values cover the entire line.

Because \(\mathbf{P}\neq\mathbf{Q}\), the direction vector is nonzero, so different parameter values give different points. This ensures that removing \(t=0\) or \(t=1\) really removes the corresponding endpoint rather than leaving it represented by some other parameter value.

Worked Examples

Worked Example: Parametrize a Closed Segment

Find a parametrization of the closed segment from \(A=(1,-2,0)\) to \(B=(4,2,6)\), and check its endpoints.

First compute the direction vector:

$$ \mathbf{d}=B-A =(4-1,\;2-(-2),\;6-0) =(3,4,6). $$

Use \(A\) as the starting point and restrict the parameter to the closed interval from zero to one:

$$ \mathbf{r}(t)=(1,-2,0)+t(3,4,6) =(1+3t,\;-2+4t,\;6t), \qquad 0\leq t\leq1. $$

At the first endpoint, substitute \(t=0\):

$$ \mathbf{r}(0)=(1+3(0),\;-2+4(0),\;6(0))=(1,-2,0)=A. $$

At the other endpoint, substitute \(t=1\):

$$ \mathbf{r}(1)=(1+3(1),\;-2+4(1),\;6(1))=(4,2,6)=B. $$

Both parameter endpoints are included, so the parametrization contains both \(A\) and \(B\). For an additional check, \(t=\frac12\) gives

$$ \mathbf{r}\left(\frac12\right) =\left(1+\frac32,\;-2+2,\;3\right) =\left(\frac52,0,3\right), $$

a point halfway between the endpoints. The interval \([0,1]\) therefore traces the closed segment from \(A\) to \(B\).

Worked Example: Parametrize a Ray Starting at the Second Point

Using \(A=(1,-2,0)\) and \(B=(4,2,6)\), parametrize the ray that starts at \(B\), passes through \(A\), and continues beyond \(A\).

The starting point must be \(B\). A direction pointing from \(B\) toward \(A\) is

$$ A-B=(1-4,\;-2-2,\;0-6)=(-3,-4,-6). $$

To include the starting point and continue in that direction, use a parameter \(s\geq0\):

$$ \mathbf{r}(s)=(4,2,6)+s(-3,-4,-6) =(4-3s,\;2-4s,\;6-6s), \qquad s\geq0. $$

At \(s=0\), the point is the starting point:

$$ \mathbf{r}(0)=(4,2,6)=B. $$

At \(s=1\), it reaches \(A\):

$$ \mathbf{r}(1)=(4-3,\;2-4,\;6-6)=(1,-2,0)=A. $$

At \(s=2\), the ray continues beyond \(A\):

$$ \mathbf{r}(2)=(4-6,\;2-8,\;6-12)=(-2,-6,-6). $$

Thus \(s\geq0\) includes \(B\), passes through \(A\), and extends beyond it in the direction from \(B\) to \(A\). If the parameter interval were \(s>0\) instead, the starting point \(B\) would be excluded.

Worked Example: Shift the Parameter Interval and Exclude One Endpoint

Use a parameter \(u\) from \(2\) to \(5\) to trace the segment from \(A=(1,-2,0)\) to \(B=(4,2,6)\), but exclude \(A\) and include \(B\).

The interval length is \(5-2=3\). Map its left endpoint \(u=2\) to the segment parameter \(t=0\), and its right endpoint \(u=5\) to \(t=1\). The corresponding segment parameter is

$$ t=\frac{u-2}{3}. $$

Substitute this into the segment formula:

$$ \mathbf{r}(u) =(1,-2,0)+\frac{u-2}{3}(3,4,6), \qquad 2<u\leq5. $$

At \(u=2\), the formula would give

$$ \mathbf{r}(2) =(1,-2,0)+\frac{2-2}{3}(3,4,6) =(1,-2,0)=A. $$

But \(u=2\) is excluded, so \(A\) is not part of the traced set. At \(u=5\),

$$ \mathbf{r}(5) =(1,-2,0)+\frac{5-2}{3}(3,4,6) =(1,-2,0)+(3,4,6) =(4,2,6)=B. $$

Since \(u=5\) is included, \(B\) is included. For an interior check, \(u=3.5\) gives \(t=(3.5-2)/3=0.5\), and hence

$$ \mathbf{r}(3.5) =(1,-2,0)+0.5(3,4,6) =(2.5,0,3). $$

This is the segment’s midpoint. The interval \((2,5]\) therefore traces the segment with \(A\) excluded and \(B\) included.

Choosing the Right Interval

For the parametrization \(\mathbf{r}(t)=\mathbf{P}+t(\mathbf{Q}-\mathbf{P})\), the common choices are:

Parameter intervalTraced setEndpoint information
\([0,1]\)Segment from \(\mathbf{P}\) to \(\mathbf{Q}\)Both endpoints included
\((0,1)\)Interior of that segmentBoth endpoints excluded
\([0,1)\)Segment with \(\mathbf{P}\) removed\(\mathbf{P}\) excluded; \(\mathbf{Q}\) included
\((0,1]\)Segment with \(\mathbf{Q}\) removed\(\mathbf{P}\) included; \(\mathbf{Q}\) excluded
\([0,\infty)\)Ray starting at \(\mathbf{P}\) toward \(\mathbf{Q}\)Starting point included
\((0,\infty)\)Same ray with its starting point removedStarting point excluded
\((-\infty,\infty)\)Entire line through \(\mathbf{P}\) and \(\mathbf{Q}\)No endpoint

For a ray starting at \(\mathbf{Q}\) and pointing toward \(\mathbf{P}\), use \(\mathbf{Q}+s(\mathbf{P}-\mathbf{Q})\) with \(s\geq0\). Starting point and direction must agree: the point at parameter zero is always the starting point, and positive parameter values follow the direction vector.

Common Mistake: Using a Segment Interval for a Ray

A frequent error is to use \(0\leq t\leq1\) when the required set is a ray. For the points \(A=(1,-2,0)\) and \(B=(4,2,6)\), the formula

$$ \mathbf{r}(t)=(1,-2,0)+t(3,4,6), \qquad 0\leq t\leq1 $$

only reaches points between \(A\) and \(B\). For instance, \(t=2\) would give \((7,6,12)\), which lies beyond \(B\), but \(t=2\) is not allowed. So this interval does not produce the ray continuing from \(A\) through \(B\).

To produce that ray, retain the same starting point and direction but allow every nonnegative parameter value:

$$ \mathbf{r}(t)=(1,-2,0)+t(3,4,6), \qquad t\geq0. $$

Now \(t=0\) gives \(A\), \(t=1\) gives \(B\), and \(t=2\) gives \((7,6,12)\). The interval, not a change to the direction vector, is what allows the parametrization to continue past \(B\).

When the Usual Construction Does Not Apply

The construction assumes that the two points are distinct. If \(\mathbf{P}=\mathbf{Q}\), then \(\mathbf{Q}-\mathbf{P}=\mathbf{0}\), and \(\mathbf{P}+t(\mathbf{Q}-\mathbf{P})\) is the same point for every \(t\). It parametrizes a single point, not a line or a ray. To describe a line or ray, choose a nonzero direction vector.

When checking any proposed parametrization, evaluate the parameter values corresponding to the intended endpoints, confirm that those values belong to the interval exactly when the endpoints should be included, and test a value beyond an endpoint if the set should continue indefinitely. These checks connect the interval to the geometry and help distinguish a segment from a ray or a full line.

Check Your Understanding

For each question, identify the parameter interval or explain what set it traces.

  1. For \(\mathbf{r}(t)=\mathbf{P}+t(\mathbf{Q}-\mathbf{P})\), which interval traces the closed segment from \(\mathbf{P}\) to \(\mathbf{Q}\)?
  2. What does the interval \(0<t\leq1\) include and exclude on that segment?
  3. How would you parametrize a ray starting at \(\mathbf{Q}\) and pointing toward \(\mathbf{P}\), with its starting point included?
  4. For the same line formula, what geometric set is traced when \(t\) ranges over all real numbers?
  5. Why does using \(0\leq t\leq1\) fail to produce a ray that continues beyond \(\mathbf{Q}\)?