Diagonal Formula

Malcolm McKinsey
Written by
Malcolm McKinsey
Fact-checked by
Paul Mazzola

The diagonal formula for squares, rectangles, cubes & polygons

Polygons are the shapes of our world. Computer and television screens, doors, and sheets of paper are all polygons. Diagonals of polygons are also useful. Learn how to instantly know how many diagonals any polygon can have by using this formula:

Get free estimates from geometry tutors near you.

What's a simple polygon?

simple polygon is any two-dimensional (flat) shape made only with straight sides that close in a space, and with sides that do not cross each other (if they do, it is a complex polygon). A triangle is a polygon. A dart, kite, quadrilateral, and star are all polygons. Simple polygons can be concave or convex. The formula we will use works for all simple polygons.

What's a diagonal?

diagonal of a polygon is a line from a vertex to a non-adjacent vertex. So a triangle, the simplest polygon, has no diagonals. You cannot draw a line from one interior angle to any other interior angle that is not also a side of the triangle. A quadrilateral, the next-simplest, has two diagonals. A pentagon, whether regular or irregular, has five diagonals.

What is A Diagonal? - Definition
What is A Diagonal? - Definition

In convex, simple polygons, diagonals will always be within the interior. Consider a rectangular door. You can run a line from the top hinge corner to the bottom, opposite corner. You can also run a line from the bottom hinge corner up to the top, opposite corner. Those are the only two diagonals possible.

In concave, simple polygons, the diagonals may go outside the polygon, crossing sides and partly lying in the shape's exterior. They are still diagonals. Darts and stars are typical examples of concave polygons with diagonals outside their shapes.

Diagonals In Concave Polygons
Diagonals In Concave Polygons

Diagonals in real life

Diagonals in squares and rectangles add strength to construction, whether for a house wall, bridge, or tall building. You may see diagonal wires used to keep bridges steady. When houses are being built, look for diagonal braces that hold the walls straight and true.

Bookshelves and scaffolding are braced with diagonals. For a catcher in softball or baseball to throw out a runner at second base, the catcher throws along a diagonal from home plate to second.

The phone or computer screen you are viewing this lesson on is measured along its diagonal. A 21" screen never tells you the width and height; it is 21" from one corner to an opposite corner.

Diagonal of a polygon formula

To find all possible diagonals of a simple polygon with just a few sides, you can easily count them. When the polygon gets a bit complicated, counting them can be very hard.

Diagonal Formula For Square, Rectangle, and Cube
Diagonal Formula For Square, Rectangle, and Cube

Fortunately, an easy formula exists to tell you exactly how many diagonals a polygon has. Remember that any vertex (corner) is connected by sides to two other vertices, so those connections cannot count as diagonals.

That vertex cannot connect to itself, either. So for n sides, we will immediately reduce the possible number of diagonals by three.

We also do not want to count the same diagonal twice. Our door, for example, only has two diagonals; you do not count going from the top hinge to bottom opposite and back again. You will have to divide any answer by two.

Diagonal formula

This leaves us with an elegant formula, where n is the number of sides (or vertices):

Get free estimates from geometry tutors near you.

How to find the diagonal of a rectangle

Test this formula with something we know: diagonals of a rectangle. A rectangle has four sides and four vertices.

Be skeptical! Try it for a pentagon (five sides):

How To Find The Diagonal
How To Find The Diagonal

A pentagon has only five diagonals; our formula works.

Be really skeptical! Try it for a tetracontakaiheptagon, which is a ridiculously long (but correct) name for a 47-gon:

Trust the formula. A 47-gon has 1,034 diagonals. This formula works every time to tell you exactly how many diagonals can be constructed inside (or outside) of any simple polygon, whether the shape is convex or concave.

Diagonal of a rectangle formula

For rectangles, l is the length of the rectangle, and b is the height of the rectangle.

Diagonal of a square formula

Now let's look at a few different diagonal formulas to find the length of a diagonal.

Where a is the side of the square.

Diagonal of a cube formula

For a cube, we find the diagonal by using a three-dimensional version of the Pythagorean Theorem/distance formula:

Lesson summary

You have learned a lot about particularly important parts of polygons, their diagonals. You now know how to identify the diagonals of any polygon, what some real-life examples of diagonals are, and how to use the formula, #ofDiagonals=n(n3)2\# of Diagonals=\frac{n(n-3)}{2},where n is the number of sides (or vertices) of the polygon.

Also, we briefly covered diagonal formulas to find the length of a diagonal in cubes squares, and rectangles.