What is a Diagonal - Definition, Formula, and Examples

What is a Diagonal - Definition, Formula, and Examples

What Is A Diagonal?

A diagonal is a line segment that connects two corners of a polygon that are not next to each other. A polygon's sides already join adjacent corners; a diagonal reaches across the shape to link corners that no side connects. The word comes from the Greek diagonios, "from angle to angle."

Two conditions define it, and both matter. A diagonal must (1) join two vertices, and (2) those vertices must be non-adjacent, meaning corners with no shared side. A line from a corner to the midpoint of a side is not a diagonal; neither is a side itself. Only corner-to-non-neighbouring-corner segments count.

Why Does A Triangle Have No Diagonals?

A triangle is the one polygon with zero diagonals, and seeing why locks in the definition. A triangle has three corners, and every corner is adjacent to the other two, so there is no pair of non-adjacent vertices to connect. Any line you draw between two corners of a triangle is already a side. With no non-adjacent corners, there is nothing for a diagonal to join.

This is the floor of the counting formula below: diagonals only appear once a polygon has four or more sides, because four is the first count that creates a pair of corners not joined by a side.

How Many Diagonals Does A Polygon Have? The Formula

The number of diagonals in a polygon with n sides (and therefore n vertices) is:

Number of diagonals = n(n−3)/2

Here n is the number of sides. The formula works for any simple polygon, regular or irregular.

Where The Formula Comes From

The derivation is worth following once, because it explains both the (n−3) and the division by 2.

  1. Start from one vertex. It can connect to n−1 other vertices in total.
  2. Remove the sides. Of those, two are its immediate neighbours, and connecting to them gives sides, not diagonals. That leaves n−3 diagonals from each vertex.
  3. Count over all vertices. With n vertices each contributing n−3 diagonals, that is n(n−3).
  4. Divide by 2. Each diagonal has been counted twice, once from each of its two endpoints, so halve the total.

This is the single most useful result on the topic, and it is also exactly the kind of formula students "know" but cannot reconstruct under pressure, which is why the step-by-step above matters more than the boxed answer.

Number of Diagonals For Common Shapes

Shape Sides (n) Diagonals
Triangle 3 0
Quadrilateral 4 2
Pentagon 5 5
Hexagon 6 9
Heptagon 7 14
Octagon 8 20
Decagon 10 35

So a hexagon has 9 diagonals; a quadrilateral, the family of squares, rectangles, and parallelograms, always has exactly 2.

Length of A Diagonal

Counting diagonals is one question; measuring one is another. For the regular shapes you meet most, the diagonal length comes straight from the Pythagorean theorem, because a diagonal usually splits the shape into right triangles.

Square, side s. The diagonal is the hypotenuse of a right triangle with both legs equal to s: d = s√2

Rectangle, length l and width w. The diagonal is the hypotenuse of a right triangle with legs l and w: d = √(l² + w²)

Diagonals of 3D shapes

In three dimensions, "diagonal" splits into two kinds, and the distinction is a common point of confusion. A face diagonal lies on one flat face of the solid; it is just a 2D diagonal of that face. A space diagonal (or body diagonal) cuts through the interior of the solid, joining two corners that share neither a face nor an edge.

For a rectangular box (cuboid) with edges l, w, and h, the space diagonal extends the Pythagorean idea into 3D: d = √(l² + w² + h²)

Examples of What is a Diagonal

Example 1

How many diagonals does an octagon (8 sides) have?
n(n−3)/2 = 8(8−3)/2 = 20
Final answer: 20 diagonals.

Example 2

A student counts the diagonals of a pentagon by drawing 5 lines from each of its 5 corners, getting 25. Why is that wrong?
The correct method: from each vertex there are n−3 = 5−3 = 2 diagonals. Over 5 vertices that is 5×2=10, and dividing by 2 gives: 5(5−3)/2 = 5 Final answer: A pentagon has 5 diagonals, not 25.

Example 3

A polygon has 9 diagonals. How many sides does it have?
Set the formula equal to 9 and solve:
n(n−3)/2 = 9
Final answer: 6 sides, a hexagon.

Example 4

Find the length of the diagonal of a square with side 8 cm.
d = 8√2 ≈ 11.31 cm
Final answer: 8√2 cm, about 11.31 cm.

Example 5

Find the space diagonal of a box measuring 3 cm by 4 cm by 12 cm.
d = √(3² + 4² + 12²) = √169 = 13 cm
Final answer: 13 cm.

Example 6

How many diagonals does a decagon (10 sides) have?
Total diagonals = 10(10−3)/2 = 35
From a single vertex = 10−3 = 7
Final answer: 35 diagonals in total, 7 from each vertex.

Why Diagonals Matter

Diagonals are not just lines on a worksheet; they are how flat shapes are made rigid. A four-sided frame can be pushed into a leaning parallelogram, but add a diagonal brace and it locks: the diagonal turns the shape into two triangles. The diagonal is the cheapest way to make a structure hold its shape.

Conclusion