Home » Math Theory » Geometry » Line-Segment, Ray, and Line Geometry

Line-Segment, Ray, and Line Geometry

Quick answer

A line goes on forever in both directions and has no endpoints (written with ↔ over the letters, as in line XY). A ray has one endpoint and goes on forever in one direction (→, as in ray XY), and a line segment has two endpoints and a length you can measure (a bar over the letters, as in segment XY).

Reviewed by the Helping with Math Team · Updated 9 October 2026

Lines, rays and line segments

A line, line segment, and ray are all referred to as one-dimensional figures as they only have length.

A line extends endlessly in two directions and has no beginning or end. In a line, rays are included. It stretches endlessly in one direction and has a single endpoint. Another part of a line is a line segment (or simply segment). It is the only one of these concepts that have a measurement or length and has two endpoints.

We will learn more about line segments, rays, and lines in this topic. To better distinguish the three figures, we shall talk about their properties.

Line vs line segment vs ray: comparison table

The properties of a line segment, ray, and line are displayed in the table below.

PropertiesLineLine SegmentRay
EndpointsA line has no endpoints.A line segment has two endpoints.A ray has one starting point and another point near the arrowhead.
LengthA line’s length cannot be measured.A line segment’s length is measurable.A ray’s length cannot be measured.
SymbolThe symbol of a line is ↔.The symbol of a line segment is a bar ( ‾ ) over the two letters.The symbol of a ray is →.

What is a line segment?

A fixed section of a line is called a line segment. A line segment has two endpoints, which are used to name it.

For example, in the figure below, we have two points, X and Y. The section of the line from point X to point Y is line segment XY. The name of a line segment is given using capital letters. This line segment is denoted as $\overline{XY}$. 

Line segment XY with endpoints X and YXYXY
Line segment XY has two endpoints, X and Y, and a length you can measure. It is written XY with a bar over the letters.

A line segment’s length can be measured. It has a finite length because of its defined two endpoints. Real-life examples of line segments are the edges of a table, the perimeter of a sports field, and the pasta noodles for your spaghetti cravings. Line segments are also used by professionals in doing their drafts of architectural designs.

What is a ray?

A geometrical ray is a portion of a line that originates from a fixed point and extends in one direction away from the starting point. The starting point is also called the point of origin.

For example, the figure below shows that it starts from point X and point Y is near the arrow end. Ray XY is the segment that runs from point X through point Y and then extends. The name of a ray is given using capital letters; hence, it is denoted as ray $\overrightarrow{XY}$.

Ray XY with endpoint X passing through YXYXY
Ray XY starts at the endpoint X, passes through Y and goes on forever, shown by the arrowhead. It is written XY with an arrow over the letters, and the endpoint is always named first.

The indeterminate length of a ray prevents measurement of it. The endpoint serves as the beginning point for rays; however, measuring a ray is not possible without a second endpoint since the other end moves infinitely.

Rays in nature include the sun’s light. The sun, which acts as the ray’s point of origin, is the source of light. Another illustration is the light coming from a flashlight, which extends as far as light can go from the end of the flashlight.

What is a line?

A line is made up of an unlimited number of points that stretch in two opposing directions. In geometry,  when we draw a line, we use arrows at each end to show that it extends infinitely to the opposite direction. 

Let us say, for example, the line XY below. It has points X and Y, and the arrowheads at each end indicate that it extends infinitely. A line is labeled using two capital letters. Hence, the line below is denoted as $\overleftrightarrow{XY}$.

Line XY through points X and Y with arrowheads at both endsXYXY
Line XY passes through X and Y and goes on forever in both directions, shown by the two arrowheads. It has no endpoints and is written XY with a double arrow over the letters.

A line can also be named using a lowercase letter. For example, the figure below shows lines a, b, and c.

Three separate lines labelled with lowercase letters a, b and c
Lines named with lowercase letters.

There can be multiple lines that pass through a point, but there can only be one line that passes through any two points.

Left: a single line through points P and Q. Right: many lines passing through one point P
Only one line passes through two points, but many lines pass through one point.

Types of Lines

The basic lines in geometry are horizontal, vertical, parallel, perpendicular, and intersecting.

A line is considered to be horizontal when it moves straight from left to right. Horizontal lines are parallel to the x – axis in a coordinate system and perpendicular to the y – axis. The image below shows a horizontal line. 

A horizontal line with arrows at both ends
Horizontal line.

A line is vertical when it moves straight from top to bottom. Vertical lines are parallel to the y – axis in a coordinate system and perpendicular to the x – axis. The image below shows a vertical line. 

A vertical line with arrows at both ends
Vertical line.

Two straight lines are parallel when they do not cross or intersect at any point, not even at infinity. In terms of geometry, parallel lines are two separate lines that never cross each other and are located in the same plane. The image below shows two parallel lines.

Two horizontal parallel lines
Parallel lines.

In geometry, two lines are perpendicular to one another when they meet or intersect at a 90-degree angle. The image below shows two lines that are perpendicular.

A horizontal and a vertical line crossing with a 90° angle marked
Perpendicular lines.

In a plane, intersecting lines are any two or more lines that cross one another. A common point that is shared by all the crossing lines can be found there. The image below shows two intersecting lines.

Two lines crossing at a marked common point
Intersecting lines share a common point.

How to draw a line segment, ray and line

The following gives an example of how to draw a line segment, ray, and line.

Drawing a line segment

To create a line segment, join the two endpoints with a straight edge. 

Let us say, for example, we have the endpoints F and G, as shown below. We must connect the two endpoints with a straight edge to create a line segment.

  • Points F and GFGStep 1mark points F and G
  • Line segment FGFGFGStep 2draw line segment FG
Drawing line segment FG: mark points F and G, then join them with a straight line that stops at both points. Write it FG with a bar over the letters.

The name of a line segment is given using capital letters. This line segment is denoted as $\overline{FG}$. 

Drawing a ray

To draw a ray, draw a line segment starting with the endpoint and ending with an arrow rather than another endpoint. The arrow indicates that the ray never ends.

Let us say, for example; we have the endpoints A and B below. To draw a ray, we must connect these endpoints forming a line segment, then extend the straight edge and end with an arrow.

  • Points A and BABStep 1mark points A and B
  • Ray ABABABStep 2draw ray AB
Drawing ray AB: mark points A and B, then draw from the endpoint A through B and add an arrowhead past B. Write it AB with an arrow over the letters.

The name of a ray is given using capital letters; hence, it is denoted as ray $\overrightarrow{AB}$.

Drawing a line

To draw a line, create a straight edge connecting the two points and ends with arrows. The arrows indicate that the line extends in the opposite direction infinitely.

Let us say, for example; we have points J and K below. To draw a line that includes these points, we must connect them using a straight edge and end with arrows on both ends. 

  • Points J and KJKStep 1mark points J and K
  • Line JKJKJKStep 2draw line JK
Drawing line JK: mark points J and K, then draw a straight line through both with an arrowhead at each end. Write it JK with a double arrow over the letters.

A line is labeled using two capital letters; hence, the line above is denoted as $\overleftrightarrow{JK}$.

Note that lines can also be named using lowercase letters. For example, as shown below, we have lines j, k, and l.

Three lines labelled j, k and l
Lines j, k and l.

How to name lines, rays and line segments

Naming Lines

A line is continuous in both directions and has no end. Arrow tips are added at both ends, or any two points along the line, to signify the line’s infiniteness in both directions. Any two places along the line may be used when naming the line. Then, over the two letters, we add a bidirectional arrow. The symbol of a line is ↔. Examples are $\overleftrightarrow{JK}$, $\overleftrightarrow{MN}$, $\overleftrightarrow{OR}$, $\overleftrightarrow{TU}$, and $\overleftrightarrow{CD}$.

Naming Rays

A ray typically includes an arrow tip at the end to indicate that it is limitless. When we give a ray a name, we first write the letter representing the endpoint, followed by the letter representing any one point along the ray. Then, over the two letters, we add a single arrow.

Naming Line Segments

Segments are the parts of a line that have two endpoints. We use a line over the two letters that stand in for the two endpoints when naming a line segment. The symbol of a line segment is a bar ( ‾ ) over the two letters. Examples are $\overline{ST}$, $\overline{BC}$, $\overline{EF}$, $\overline{UV}$, and $\overline{GH}$.

Line, ray and line segment examples with solutions

Example 1

Will the line segments GH and KL meet anywhere?

Two parallel line segments GH and KL with endpoints marked
Example 1: line segments GH and KL.

Solution

No. The line segments $\overline{GH}$ and  $\overline{KL}$ will not meet anywhere. Note that these are line segments, and they have their endpoints. The illustration above shows that these line segments are parallel to each other, and thus, they will never meet.

Example 2

Will the lines MN and ST meet anywhere?

Two lines MN and ST slanting towards each other
Example 2: lines MN and ST.

Solution

The two lines will meet at some point at their intersection. Remember that a line extends infinitely towards the opposite directions; therefore, line MN and line ST will meet at some point when extended.

Example 3

Determine which are rays, lines, or line segments.

Six figures: lines GH and YZ with arrows at both ends, segments TU and MN with two endpoints, and rays AB and DE with one arrowhead
Example 3: sort the figures into lines, rays and line segments.

Solution

Remember that a line is a continuous, straight path that has no endpoints and travels in both directions along a plane. A line segment is a finitely long portion of a line with two endpoints. A ray has an endpoint and keeps extending in one direction.

Therefore, in the given illustration, the lines are $\overleftrightarrow{GH}$and  $\overleftrightarrow{YZ}$. Notice that these figures have arrowheads at both ends.

The line segments are $\overline{TU}$ and $\overline{MN}$. Notice that these figures have their endpoints and no arrowheads.

The rays are $\overrightarrow{AB}$ and $\overrightarrow{DE}$. These figures have starting points and arrowheads at the other end.

Example 4

Give five instances of rays, lines, and line segments.

Solution

The name of a line segment is given using capital letters. The symbol of a line segment is a bar ( ‾ ) over the two letters. Examples are $\overline{ST}$, $\overline{BC}$, $\overline{EF}$, $\overline{UV}$, and $\overline{GH}$.

The name of a ray is given using capital letters. The symbol of a ray is →. Examples are $\overrightarrow{HI}$, $\overrightarrow{LM}$, $\overrightarrow{WX}$, $\overrightarrow{AB}$, and $\overrightarrow{FG}$.

A line is labeled using two capital letters. The symbol of a line is ↔. Examples are $\overleftrightarrow{JK}$, $\overleftrightarrow{MN}$, $\overleftrightarrow{QR}$, $\overleftrightarrow{TU}$, and $\overleftrightarrow{CD}$.

Example 5

Identify the type of lines in each item.

( a )Two lines crossing each other( c )A horizontal and a vertical line crossing at right angles
( b ) Two slanted parallel lines( d ) 



A single horizontal line

Solution

( a ) intersecting lines
Two lines crossing each other

Since the two lines cross one another, they are intersecting lines. It can also be seen from the image that they have a common point.
( c ) perpendicular linesA horizontal and a vertical line crossing at right angles
Since the two lines meet or cross at a 90-degree angle, they are perpendicular to one another.
( b )  parallel lines
Two slanted parallel lines
The lines are parallel since they do not cross or intersect at any point, not even at infinity. In terms of geometry, parallel lines are two separate lines that never cross each other and are located in the same plane. The image below shows two parallel lines.
( d ) horizontal lines



A single horizontal line
The line is horizontal since it moves straight from left to right or vice versa.

More practice: spatial skill: lines, segments, and rays worksheets, parallel and perpendicular lines worksheets and equation of a straight line worksheets.

Line, ray and line segment FAQs

What is the difference between a line, a ray and a line segment?

A line has no endpoints and extends infinitely in both directions. A ray has one endpoint and keeps extending in one direction. A line segment is a finitely long portion of a line with two endpoints.

Can you measure a line, a ray or a line segment?

Only a line segment. A line segment’s length is measurable because it has two endpoints. A line and a ray go on forever, so their lengths cannot be measured.

How do you name a ray?

Write the letter for the endpoint first, followed by the letter for any one point along the ray, with an arrow → over them. Ray AB starts at A and passes through B, so ray AB is not the same as ray BA.

What are real-life examples of rays and line segments?

Rays: the sun’s light and the beam from a flashlight, which start at a source and travel in one direction. Line segments: the edges of a table and the pasta noodles for your spaghetti.

What are the types of lines?

The basic lines in geometry are horizontal, vertical, parallel, perpendicular, and intersecting lines.

How many lines pass through two points?

There can be multiple lines that pass through a point, but there can only be one line that passes through any two points.

Practise with worksheets

Link/Reference Us

We spend a lot of time researching and compiling the information on this site. If you find this useful in your research, please use the tool below to properly link to or reference Helping with Math as the source. We appreciate your support!

  • "Line-Segment, Ray, and Line Geometry". Helping with Math. Accessed on November 12, 2026. https://helpingwithmath.com/line-segment-ray-and-line-geometry/.

  • "Line-Segment, Ray, and Line Geometry". Helping with Math, https://helpingwithmath.com/line-segment-ray-and-line-geometry/. Accessed 12 November, 2026.

  • Line-Segment, Ray, and Line Geometry. Helping with Math. Retrieved from https://helpingwithmath.com/line-segment-ray-and-line-geometry/.