Library / Geometry, coordinates, surveying and trigonometry / GEO-05
Geometry, coordinates, surveying and trigonometry
Number of diagonals in a polygon
Count of diagonals of a convex polygon with n vertices: the pairs of non-adjacent vertices.
- Ref
- GEO-05
- Rev
- v1
- Field
- Geometry, coordinates, surveying and trigonometry
- Result
- D
A convex polygon with n vertices has n(n − 3)/2 diagonals. From each vertex you can draw n − 3 diagonals (not to itself or its two neighbours), and dividing by 2 stops each diagonal being counted from both ends. A triangle has none and a quadrilateral has two.
Count of diagonals of a convex polygon with n vertices: the pairs of non-adjacent vertices. A triangle has none.
Calculator
- Number of sides8
- Number of diagonals from one vertex, n − 35
- Total number of lines between vertices, n(n − 1)/228
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- A polygon with 8 vertices has 20 diagonals, out of 28 possible lines between pairs of vertices.
- The 8 sides account for the remaining 8 lines between vertices, which is why D = n(n − 1)/2 − n.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| n Number of vertices | 3 to 40 | 0 | 740 | 740 | +1 | +35 % |
Sweep of Number of vertices
| Number of vertices | Number of diagonals |
|---|---|
| 3 | 0 |
| 7.625 | 17.63 |
| 12.25 | 56.66 |
| 16.88 | 117.1 |
| 21.5 | 198.9 |
| 26.13 | 302.1 |
| 30.75 | 426.7 |
| 35.38 | 572.6 |
| 40 | 740 |
Sweep one variable
Variables and how each one contributes
Number of diagonals
What the equation gives you. Everything else feeds it.
Number of vertices
The number of vertices (corners), a whole number from 3. The count grows with the square of n, so it rises much faster than the number of sides. Raising it by 1 (to 9) moves the result by +35 %, from 20 to 27.
Worked example with the values above
- Number of vertices: n = 8.
- Diagonals from one vertex: n − 3 = 5, so 8 × 5 = 40 counted from both ends.
- D = 40 / 2 = 20.
Assumptions and limits
- A convex polygon, so that every diagonal lies inside it.
- n is a whole number of at least 3.
Common mistakes
- Counting each diagonal twice by not dividing by 2.
- Counting the sides as diagonals, which gives n(n − 1)/2 instead.
- Using n sides in place of n vertices for a shape with a gap or a re-entrant corner.
Statistics and uncertainty
This is an exact count, so there is no measurement uncertainty. The count grows with the square of n, so a miscount of vertices is magnified.
Where it is used
- Plate, panel and gasket areas from simple drawings.
- Checking the size of regular flanges, hex bars and tiles.
Maths you need
- Area: the flat space inside a shape, in square units
- Perpendicular: at a right angle to
- Tangent of an angle: opposite over adjacent