Line Segments

Part 11, Chapter 11: Lines, Rays, and Segments

Learning objectives

  • Define a line segment between two points using a parametric description
  • Evaluate the parametric form to find points on a segment
  • Understand the parameter range for segments

A segment is the simplest geometric object after a point. Pick two points, draw the straight piece between them, and you have a segment. The non-obvious thing, the thing this section exists to teach, is that this segment has a clean algebraic description: every point on it is a weighted average of the two endpoints, controlled by a single parameter tt between 00 and 11. The parametric idea you learn here scales up to rays, lines, curves, and even multi-dimensional surfaces.

The parametric form

Given endpoints AA and BB, the segment from AA to BB consists of all points

P(t)=(1t)A+tBquadtextfor0leqtleq1.P(t) = (1 - t)A + tB \quad \text{for } 0 \leq t \leq 1.

Check the endpoints: P(0)=AP(0) = A (start) and P(1)=BP(1) = B (end). For tt strictly between 00 and 11 you sweep continuously across the interior. An equivalent rearrangement uses the direction vector BAB - A:

P(t)=A+t(BA).P(t) = A + t(B - A).

This makes the geometry transparent: start at AA, move tt of the way toward BB.

Where this shows up
  • Computer Graphics: Every line of code that draws a line segment between two pixels, CAD, game UI, data plots, uses the parametric form P(t)=P0+t(P1P_0)P(t) = P_0 + t(P_1 - P_0) for t \in [0, 1], rasterised one pixel per step.
  • Game Design: Pathfinding for a unit moving from A to B clamps its position to the segment overlineAB\overline{AB} until it reaches B; the parameter tt here is the fraction of the route completed.
  • Animation: Linear interpolation (lerp) between two key positions is segment parametrisation: at t=0.5t = 0.5, the character is exactly halfway between start and end. Every smooth motion in modern animation is built from chained lerps.

Switch to "segment" mode in the widget. Drag the anchor AA; adjust slope and intercept; the line between the green and orange dots is the segment from AA to the next-unit point BB.

The midpoint and other proportional points

The parameter tt literally represents the fraction of the way from AA to BB. Some special values:

  • t=0t = 0: the point AA.
  • t=1/4t = 1/4: a quarter of the way from AA to BB.
  • t=1/2t = 1/2: the midpoint, tfrac12(A+B)\tfrac{1}{2}(A + B), same as the midpoint formula.
  • t=2/3t = 2/3: two-thirds of the way from AA to BB.
  • t=1t = 1: the point BB.

For any rational p/qp/q, the point P(p/q)P(p/q) divides the segment in ratio p:(qp)p : (q - p) from AA. This is how segment bisection, trisection, and general division calculations all reduce to one formula.

From point-set to parametric formula

The leap of insight here is that a one-dimensional geometric set (a segment, a curve in the plane, etc.) can be described by a one-dimensional algebraic parameter. The segment is the image of [0, 1] under the function tmapsto(1t)A+tBt \mapsto (1-t)A + tB. This idea, encoding geometry as a parametric function, is what allows you to describe curves you cannot easily draw, and it returns in calculus and in physics (motion of a particle along a trajectory).

Try it

  • For A=(1,2)A = (1, 2) and B=(7,5)B = (7, 5) at t=1/3t = 1/3: P=(2/3)(1,2)+(1/3)(7,5)=(3,3)P = (2/3)(1, 2) + (1/3)(7, 5) = (3, 3).
  • For A=(2,4)A = (2, -4) and B=(6,8)B = (6, 8) at t=1/2t = 1/2: midpoint is (4,2)(4, 2), matching the midpoint formula.
  • For A=(0,2)A = (0, -2) and B=(8,6)B = (8, 6) at t=3/4t = 3/4: P=(tfrac14)(0,2)+(tfrac34)(8,6)=(6,4)P = (\tfrac{1}{4})(0, -2) + (\tfrac{3}{4})(8, 6) = (6, 4).

A trap to watch for

The parameter range 0leqtleq10 \leq t \leq 1 is what makes the formula represent a segment rather than an entire line. If you let tt go negative or above 11, you get points outside the segment, on the ray extending past AA or past BB. Common confusion: the formula P(t)=(1t)A+tBP(t) = (1 - t)A + tB only describes the segment when you restrict tt; the same formula with unrestricted tinmathbbRt \in \mathbb{R} describes the full line. Always check which object you mean. The next two sections formalise rays and lines using exactly this idea.

What you now know

You can describe any segment by a parametric formula, compute the point at any fraction along it (midpoint, quarter, ratio division), and connect the parametric description to the midpoint formula from §8.2. The next section relaxes the parameter range to tgeq0t \geq 0 to describe rays.

Quick check

Mark section complete →

References

  • Lang, S. (1971). Basic Mathematics. Springer. Chapter 10, §1, segments via the parametric form.
  • Euclid (c. 300 BCE). Elements, Book I, Definitions 3-4 (Heath translation, Dover, 1956). The axiomatic origin of "segment" between two points.
  • Coxeter, H. S. M. (1969). Introduction to Geometry, 2nd ed. Wiley. §13 covers convex combinations, segments as the simplest example.
  • Stewart, J. (2015). Calculus, 8th ed. Cengage. Chapter 10 develops parametric curves as a generalisation of this idea.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.