Diagonal Calculator
Calculate the diagonal of a rectangle, square, or cube from side lengths. Enter values for instant results with step-by-step formulas.
Formula
Rectangle: d = sqrt(l^2 + w^2) | Square: d = s x sqrt(2) | Cube: d = s x sqrt(3)
Diagonal calculations use extensions of the Pythagorean theorem. For 2D shapes, the diagonal is the hypotenuse of a right triangle formed by the sides. For 3D shapes, the space diagonal extends through the interior connecting opposite vertices using all three dimensions.
Worked Examples
Example 1: TV Screen Size Calculation
Problem: A TV has a 16:9 aspect ratio with dimensions of 47.9 inches wide and 27.0 inches tall. What is the screen diagonal?
Solution: Using the rectangle diagonal formula:\nd = sqrt(l^2 + w^2)\nd = sqrt(47.9^2 + 27.0^2)\nd = sqrt(2294.41 + 729.00)\nd = sqrt(3023.41)\nd = 54.99 inches (marketed as 55 inches)
Result: Diagonal: 55.0 inches | This confirms the standard 55-inch TV size
Example 2: Shipping Box Space Diagonal
Problem: A shipping box measures 24 inches long, 18 inches wide, and 12 inches tall. What is the longest item (placed diagonally) that can fit inside?
Solution: Space diagonal = sqrt(l^2 + w^2 + h^2)\nd = sqrt(24^2 + 18^2 + 12^2)\nd = sqrt(576 + 324 + 144)\nd = sqrt(1044)\nd = 32.31 inches\nFace diagonal (base) = sqrt(576 + 324) = sqrt(900) = 30.0 inches
Result: Space Diagonal: 32.31 inches | Base Face Diagonal: 30.0 inches
Frequently Asked Questions
What is a diagonal and how is it calculated?
A diagonal is a straight line segment that connects two non-adjacent vertices (corners) of a polygon or polyhedron. In two-dimensional shapes like rectangles and squares, the diagonal runs from one corner to the opposite corner, cutting through the interior of the shape. In three-dimensional shapes like cubes and rectangular prisms, there are two types of diagonals: face diagonals (which lie on a single face) and space diagonals (which pass through the interior of the solid from one vertex to the opposite vertex). Diagonals are calculated using the Pythagorean theorem extended to the appropriate number of dimensions. For a rectangle with length l and width w, the diagonal equals the square root of (l squared plus w squared).
How do you find the diagonal of a rectangle?
The diagonal of a rectangle is found using the Pythagorean theorem since the diagonal, length, and width form a right triangle. The formula is d = sqrt(l squared + w squared), where l is the length and w is the width. For example, a rectangle with length 8 and width 6 has a diagonal of sqrt(64 + 36) = sqrt(100) = 10. A rectangle has two diagonals of equal length that bisect each other at their midpoints but are not perpendicular. The angle the diagonal makes with the length side is arctan(w/l), and with the width side is arctan(l/w). This calculation is fundamental in construction, carpentry, and design, where measuring the diagonal is used to verify that corners are perfectly square.
What is the diagonal of a square and why is it special?
The diagonal of a square has a uniquely simple relationship to its side length: d = s times the square root of 2, where s is the side length. This means the diagonal is always approximately 1.4142 times the side length. The square root of 2 is an irrational number, which means even a square with integer side lengths will have an irrational diagonal length. This was one of the earliest mathematical discoveries of irrational numbers, attributed to the Pythagoreans around 500 BCE. A square has two diagonals that are equal in length and bisect each other at right angles (90 degrees), dividing the square into four congruent right triangles. Each diagonal also bisects the vertex angles, creating 45-degree angles at each corner.
How do you calculate the space diagonal of a cube?
The space diagonal of a cube, which runs from one vertex through the interior to the opposite vertex, is calculated as d = s times the square root of 3, where s is the edge length. This formula is derived by applying the Pythagorean theorem twice: first to find the face diagonal (s times sqrt(2)), then using that face diagonal and the edge as the two legs of a right triangle to find the space diagonal. For a cube with edge length 10, the space diagonal is 10 times sqrt(3), which equals approximately 17.32. A cube has 4 space diagonals, all equal in length, and 12 face diagonals (2 per face), each equal to s times sqrt(2). The space diagonal makes an angle of approximately 54.74 degrees with any edge it connects to.
What is the space diagonal of a rectangular prism?
The space diagonal of a rectangular prism (also called a cuboid or box) is calculated using the three-dimensional extension of the Pythagorean theorem: d = sqrt(l squared + w squared + h squared), where l, w, and h are the three edge lengths. This formula can be understood as a two-step process: first calculate the diagonal of the base face, then use that as one leg of a right triangle with the height as the other leg. For a box measuring 3 by 4 by 5, the space diagonal is sqrt(9 + 16 + 25) = sqrt(50) = approximately 7.07. A rectangular prism has 4 space diagonals, which are all equal in length. It also has 12 face diagonals in three groups of 4, with each group corresponding to one of the three pairs of opposite rectangular faces.
Why is diagonal measurement important in construction?
Diagonal measurement is one of the most fundamental techniques in construction for verifying that a structure is square and true. When building a rectangular foundation, deck, or frame, measuring both diagonals and confirming they are equal guarantees that all four corners are 90-degree right angles. If the diagonals are unequal, the structure is out of square, forming a parallelogram instead of a rectangle. This technique, often called cross-measuring or checking for square, has been used by builders for thousands of years. The 3-4-5 triangle method, which creates a diagonal of exactly 5 when sides are 3 and 4, is a specific application used to lay out right angles on construction sites. Modern laser measuring tools can check diagonals with millimeter precision over distances of hundreds of feet.