Lines, Line Segments, Rays, and Opposite Rays

Updated 15 November 2026

A line continues in two directions, a ray continues in one direction, and a line segment stops at two endpoints. Opposite rays share an endpoint and point in exactly opposite directions along the same line.

Lines, segments, and rays playground

Choose an object, then drag A and B or edit their coordinates. The grid uses the same scale horizontally and vertically. Coordinates run from −9 to 9, with up to two decimal places.

Compare the objects

ObjectEndpointsExtent
Line ABNoneBoth directions without end
Segment ABTwo: A and BOnly between its endpoints
Ray ABOne: AFrom A through B, and beyond B

Notation: line \(\overleftrightarrow{AB}\), segment \(\overline{AB}\), and ray \(\overrightarrow{AB}\).

What is a line?

A line is straight and extends indefinitely in both directions. It contains infinitely many points. Two distinct points determine exactly one line; one point alone does not fix a unique line.

TAKE A CLOSER LOOKImage previewPNG · 7 KB
line xya
Download image

You can name a line using two points on it, such as line XY, or a lowercase label such as line a. Naming two points does not mean the line contains only those points.

TAKE A CLOSER LOOKImage previewPNG · 30 KB
lines
Download image

What is a line segment?

A segment is the part of a line between two endpoints, including the endpoints. Its length is finite and can be measured.

TAKE A CLOSER LOOKImage previewPNG · 14 KB
line segment example
Download image
TAKE A CLOSER LOOKImage previewPNG · 5 KB
line segments
Download image
Distance between two coordinate points

\[AB=\sqrt{(x_B-x_A)^2+(y_B-y_A)^2}\]

For A = (0, 0) and B = (3, 4), the length is \(\sqrt{3^2+4^2}=5\) units. In the playground, non-exact decimal lengths are marked as approximations.

What is a ray?

A ray has one endpoint and continues indefinitely in one direction. In ray AB, A is the endpoint; B is another point that specifies the direction. B is not a second endpoint.

TAKE A CLOSER LOOKImage previewJPG · 25 KB
ray example
Download image
TAKE A CLOSER LOOKImage previewPNG · 5 KB
ray xy pic
Download image

Order matters: \(\overrightarrow{AB}\) and \(\overrightarrow{BA}\) usually describe different rays. The arrowhead in a drawing indicates continuation; it is not the ray's endpoint.

What are opposite rays?

Opposite rays have the same endpoint, lie on the same straight line, and extend in opposite directions. Their union is the whole line, and they form a straight angle of 180°.

TAKE A CLOSER LOOKImage previewPNG · 8 KB
Lines, Line Segments, Rays, and Opposite Rays — visual example
Download image

In the diagram, rays ZX and ZY start at Z and point in opposite directions. Rays that start at the same point but form a 90° angle are not opposite rays.

Try these checks

  1. Select segment AB and set A to (0, 0), B to (3, 4). Check its 5-unit length.
  2. Switch to ray AB. Notice that the drawing continues past B but starts at A.
  3. Choose opposite rays. Both rays keep the same endpoint even as you change the direction.

If A and B coincide, they cannot specify a unique line or ray direction. The tool rejects that case for lines and rays. A coincident-endpoint segment is allowed as a degenerate segment of length zero.

Practice

Which object has exactly one endpoint? Does a line through A and B stop at B? Do two rays with different endpoints form opposite rays?

Check the answers

A ray. No, a line continues beyond B in both directions. No, opposite rays must share the same endpoint.

Use these ideas in the linear pair lesson, or try the line and ray identification game.