Rays and Half-Lines

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

Learning objectives

  • Define a ray starting from a point in a given direction
  • Write the parametric form for a ray
  • Distinguish between rays and segments by the parameter range

A ray is a segment that does not stop. Stand at a point AA, pick a direction (say, toward another point BB), and walk forever. The trail you trace out is a ray, it has a starting endpoint but no terminal one. We have already done the algebraic work for segments; this section adapts it to rays simply by letting the parameter tt grow without bound.

The parametric form

Given a starting point AA and a "direction" point BB, the ray from AA through BB is

P(t)=(1t)A+tB;=;A+t(BA)quadtextfortgeq0.P(t) = (1 - t)A + tB \;=\; A + t(B - A) \quad \text{for } t \geq 0.

At t=0t = 0 you are at AA; at t=1t = 1 you reach BB; for t>1t > 1 you continue past BB in the same direction. The constraint tgeq0t \geq 0 is what distinguishes a ray from a segment (which had 0leqtleq10 \leq t \leq 1) or a full line (which has tinmathbbRt \in \mathbb{R}).

Where this shows up
  • Computer Graphics: A ray traced from a camera through a pixel into a scene is mathematically P(t)=textorigin+tcdottextdirectionP(t) = \text{origin} + t \cdot \text{direction} with tgeq0t \geq 0; ray-tracing renderers test each ray for intersection with scene geometry to colour the pixel.
  • Physics: A laser beam is a physical ray: it starts at the emitter and continues in a straight direction (assuming no obstacles or atmosphere); the tgeq0t \geq 0 constraint excludes "behind the laser" from any meaningful question.
  • Optics: Snell's law of refraction traces light rays from the source through interfaces: each segment is a ray with tgeq0t \geq 0 until it hits the next surface, where a new ray is spawned.

Switch to "ray" mode. The widget shows a ray starting at the green anchor and extending in the slope direction. The dashed extension is the "opposite" direction the ray does not include.

Direction vector

The vector BAB - A is the direction vector of the ray. Any positive scalar multiple of it represents the same direction, so the same ray. Example: with A=(1,2)A = (1, 2) and B=(4,6)B = (4, 6), the direction vector is (3,4)(3, 4), and the ray is

P(t)=(1+3t,;2+4t)quadtextfortgeq0.P(t) = (1 + 3t,\; 2 + 4t) \quad \text{for } t \geq 0.

At t=2t = 2 you are at (7,10)(7, 10), on the same ray but beyond BB.

Rays from the origin and same-direction tests

A ray from the origin in the direction of a nonzero point PP is the set tP:tgeq0\{tP : t \geq 0\}. Two nonzero points PP and QQ lie on the same ray from the origin precisely when Q=cPQ = cP for some positive scalar cc. If cc is negative, they lie on opposite rays through the origin, the same straight line, but pointing the wrong way.

Why rays matter

Rays are the building block for two geometric notions you have already met:

  • An angle (§5.2) is the wedge between two rays sharing a common endpoint (the vertex).
  • A convex set (the kind of region a parallelogram or disc encloses) is characterised by which rays it contains.

Beyond geometry, rays show up in linear programming, convex optimization, and the geometry of light. Half-lines are everywhere.

Try it

  • Ray from A=(2,1)A = (2, 1) toward B=(5,3)B = (5, 3). Direction (3,2)(3, 2). At t=3t = 3: P=(2,1)+3(3,2)=(11,7)P = (2, 1) + 3(3, 2) = (11, 7).
  • Ray from origin through (3,1)(3, -1): every point on it has the form (3t,t)(3t, -t) for tgeq0t \geq 0. Try t=0.5t = 0.5: (1.5,0.5)(1.5, -0.5).
  • Do (4,6)(4, 6) and (6,9)(6, 9) lie on the same ray from the origin? Yes, (6,9)=1.5cdot(4,6)(6, 9) = 1.5 \cdot (4, 6) and 1.5>01.5 > 0.

A trap to watch for

A common confusion is between a ray and its "reverse" ray. The ray from AA toward BB uses tgeq0t \geq 0. The ray from AA in the opposite direction is a different ray, requiring tleq0t \leq 0 in the same parametrisation. Two rays sharing the same endpoint but pointing opposite ways together form a line. So "the line ABAB" includes both rays, while "the ray from AA through BB" is only one of them. Watch the direction language carefully on a problem, "from AA to BB" and "from BB to AA" describe different rays.

What you now know

You can describe any ray by a parametric formula, identify its direction vector, and decide whether two points lie on the same ray from a given origin. The next section relaxes the parameter range completely, tinmathbbRt \in \mathbb{R}, to describe lines.

Quick check

Mark section complete →

References

  • Lang, S. (1971). Basic Mathematics. Springer. Chapter 10, §2, rays via the parametric form.
  • Coxeter, H. S. M. (1969). Introduction to Geometry, 2nd ed. Wiley. §13 develops half-lines and convex cones.
  • Rockafellar, R. T. (1970). Convex Analysis. Princeton University Press. §1 defines rays and uses them for convex set theory.
  • Hartshorne, R. (2000). Geometry: Euclid and Beyond. Springer. Chapter 1 reconciles the parametric and synthetic definitions of a ray.

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