Space Diagonal of a Prism: The Longest Rod That Fits — 3D Pythagorean Theorem
The classic engineering puzzle — "what is the longest rod that fits inside a box?" — is answered entirely by the space diagonal formula. By applying the 3D Pythagorean theorem, d = √(l² + w² + h²), you find the exact length of the longest straight line that can fit inside any rectangular prism. This guide develops the formula from first principles, distinguishes face diagonals from space diagonals, extends the concept to hexagonal prisms, and provides an interactive calculator for packaging, shipping, and construction design.
Prism Diagonal Formulas at a Glance
| Diagonal Type | Formula | Notes |
|---|---|---|
| Space (Body) Diagonal | d = √(l² + w² + h²) | Longest line inside the prism; crosses interior |
| Base Face Diagonal (l×w) | f₁ = √(l² + w²) | Lies on top/bottom face |
| Side Face Diagonal (l×h) | f₂ = √(l² + h²) | Lies on front/back face |
| Side Face Diagonal (w×h) | f₃ = √(w² + h²) | Lies on left/right face |
| Cube Space Diagonal | d = a√3 ≈ 1.732a | Special case when l = w = h = a |
| Hexagonal Prism Diagonal | d = √(4s² + h²) | s = side length; 2s = hex diameter |
| Find h from d, l, w | h = √(d² − l² − w²) | Inverse formula for constraint design |
Space Diagonal Calculator
Enter dimensions to compute all face diagonals, the space diagonal, and the hexagonal prism diagonal.
For a regular hexagonal prism, the circumradius R equals the side length s, so the longest base-to-base diagonal through opposite corners = 2s.
From 2D to 3D: The Pythagorean Theorem in Space
The space diagonal formula is a natural extension of the classic Pythagorean theorem into three dimensions. To see why, let's build up from one dimension at a time.
Building Up: 1D → 2D → 3D
Step 1 — In 1D (a line):
The "diagonal" of a segment of length l is just l itself.
Step 2 — In 2D (a rectangle l × w):
The Pythagorean theorem gives the face diagonal:
Step 3 — In 3D (a box l × w × h):
We apply Pythagoras again, treating f as one leg and h as the other:
This stepwise extension works because the base face diagonal is perpendicular to the height edge in a right prism. The triangle formed by the base face diagonal, the vertical height edge, and the space diagonal is a right triangle — so the standard Pythagorean theorem applies.
This is more than a trick. In three-dimensional Euclidean space, the straight-line (Euclidean) distance between two points and is:
For a rectangular prism with one corner at the origin and the opposite corner at , the space diagonal is exactly this 3D Euclidean distance: .
Space Diagonal Derivation — Step by Step
Let the rectangular prism have length , width , and height . Place one corner at the origin. The space diagonal connects vertex to the opposite vertex .
Find the base face diagonal
The bottom face is a rectangle with vertices at , , , and . Its diagonal:
Identify the right triangle
Consider the triangle formed by: vertex , the far corner of the base , and the top corner . The segment AC has length , segment CB has length , and the angle ACB = 90° (CB is vertical, AC is horizontal). So triangle ACB is a right triangle.
Apply Pythagorean theorem to get the space diagonal
Result — The Space Diagonal Formula
This formula is symmetric in l, w, h — the diagonal doesn't depend on which dimension is "length" vs "width" vs "height". It's the maximum straight-line distance between any two points in or on the prism.
Face Diagonals vs. Space Diagonal — When Each Matters
A rectangular prism has 4 space diagonals and 12 face diagonals (2 on each of the 6 faces). All 4 space diagonals are equal in length (= ). The face diagonals come in three distinct lengths depending on which pair of dimensions they span.
| Diagonal | Lies On | Formula | Practical Use |
|---|---|---|---|
| Face (l×w) | Top/bottom face | √(l²+w²) | Shelf depth fitting, floor plan |
| Face (l×h) | Front/back face | √(l²+h²) | Wall panel bracing, stair stringer |
| Face (w×h) | Left/right face | √(w²+h²) | Side panel bracing, cross-brace |
| Space Diagonal | Interior of prism | √(l²+w²+h²) | Max rod length, 3D bracing |
Key insight: The space diagonal is always longer than any face diagonal. This follows directly from the formula — adding a positive term under the square root always increases the result. In inequality form:
Face diagonals matter when you're working with objects that travel along one face (a ruler sliding into a flat drawer), while the space diagonal matters when the object must traverse the full 3D interior (a rod sliding into a box at an angle).
Hexagonal Prism Space Diagonal
A regular hexagonal prism has a regular hexagon as its base. The key geometric fact about a regular hexagon with side length is that the circumradius (center to vertex) equals . Therefore, the distance between two diametrically opposite vertices of the hexagon is:
The longest space diagonal of a hexagonal prism connects a vertex on the bottom hexagon to the diametrically opposite vertex on the top hexagon. Using the same 2D→3D Pythagorean extension:
Why 2R = 2s for Regular Hexagons
A regular hexagon can be decomposed into 6 equilateral triangles, each with side length equal to the hexagon's side . Since the circumradius of an equilateral triangle equals its side length, the circumradius of the regular hexagon also equals . This elegant property is unique to hexagons among all regular polygons.
There is also a shorter space diagonal connecting adjacent vertices on opposite ends — this spans the center-to-vertex distance in a different direction. For a regular hexagon, the distance between two vertices separated by one vertex (not diametrically opposite) equals . The corresponding prism diagonal is . However, the longest diagonal (the one relevant to fitting the longest rod) is always .
Real-World Applications
The space diagonal formula appears in a surprising range of practical engineering and logistics problems.
📦 Shipping & Packaging
Fishing rods, golf clubs, skis, and curtain rods are often longer than any single box dimension. Shippers must find a box whose space diagonal ≥ item length. A ski box 84×12×6 in has d = √(7056+144+36) ≈ 84.9 in — just enough for an 84-inch ski.
🔧 Pipe Fitting in Ducts
HVAC engineers need to route rigid pipe sections through rectangular duct openings. The maximum pipe length that passes through a rectangular duct opening at any angle is the face diagonal of the cross-section; to route it along the duct's interior, the space diagonal formula applies.
🏗️ Construction Bracing
Cross-bracing inside a rectangular structural frame uses diagonal members. The length of the brace equals the face diagonal of the framed rectangle. Three-dimensional space diagonals appear in geodesic dome structures and space frames.
📐 Monitor & TV Sizes
Display sizes are measured along the screen diagonal — that's the face diagonal of the rectangular screen. A "65-inch TV" with 16:9 aspect ratio has dimensions 56.7 in × 31.9 in (since 16k, 9k satisfy √(256k²+81k²)=65, giving k≈1.89 in). The TV packaging box must then accommodate the space diagonal including depth.
The Cube Special Case — d = a√3
When all three dimensions are equal (), the rectangular prism becomes a cube and the space diagonal formula simplifies beautifully:
The factor is a fundamental geometric constant for cubes. No matter the cube size, the space diagonal is always approximately 1.732 times the edge length.
| Cube Side a | Face Diagonal a√2 | Space Diagonal a√3 | Ratio d/a |
|---|---|---|---|
| 1 in | 1.414 in | 1.732 in | √3 |
| 6 in | 8.485 in | 10.392 in | √3 |
| 12 in (1 ft) | 16.971 in | 20.785 in | √3 |
| 24 in (2 ft) | 33.941 in | 41.569 in | √3 |
| 100 cm | 141.421 cm | 173.205 cm | √3 |
The cube case is also notable because all three face diagonals are equal (), and all four space diagonals are equal. The and factors are irrational — this means that for any cube with integer side length, neither the face diagonal nor the space diagonal is rational. This has a famous connection to number theory: no "perfect cuboid" with all integer edges, face diagonals, and space diagonal is known to exist.
Worked Examples
Question: What is the longest fishing rod that fits diagonally inside a shipping box measuring 24 in × 16 in × 12 in?
Given: l = 24 in, w = 16 in, h = 12 in
Face diagonals:
Space diagonal:
Answer: The longest rod that fits is ≈ 31.24 inches — about 7.24 inches longer than the longest face diagonal of 28.84 in.
Question: Find the space diagonal of a regular hexagonal prism with side 6 in and height 24 in.
Given: s = 6 in, h = 24 in
Hex base diameter: 2s = 12 in
Answer: The longest internal diagonal is ≈ 26.83 inches.
Question: A rod is 25 inches long. If l = 15 in and w = 12 in, what is the minimum box height needed to fit the rod?
Given: d = 25 in, l = 15 in, w = 12 in. Solve for h:
Answer: The box must be at least 16 inches tall. Note: 25 is a Pythagorean quadruple — an integer solution to l² + w² + h² = d².
Frequently Asked Questions
What is the space diagonal of a rectangular prism?
The space diagonal (also called the body diagonal) is the line segment that runs from one corner of the rectangular prism to the diagonally opposite corner, passing through the interior of the solid. It is the longest possible straight-line distance between any two points inside or on the prism, and equals d = √(l² + w² + h²) — a direct application of the 3D Pythagorean theorem.
How is the space diagonal different from a face diagonal?
A face diagonal lies entirely on one rectangular face and connects two opposite corners of that face. For a rectangular prism, the three face diagonals are: √(l²+w²) on the l×w base, √(l²+h²) on the l×h side, and √(w²+h²) on the w×h side. The space diagonal connects corners that are not on the same face, passing through the interior. The space diagonal is always longer than any face diagonal.
Does the formula work for oblique prisms?
No — the formula d = √(l²+w²+h²) strictly applies to right rectangular prisms (cuboids) where all lateral edges are perpendicular to the base. For oblique prisms, the internal geometry is more complex because the lateral edges are not perpendicular, so you must decompose the displacement vector between opposite corners using vector arithmetic. The result depends on the tilt angle of the lateral edges.
What is the longest rod that fits inside a cube with side a?
For a cube of side length a, the space diagonal formula gives d = √(a²+a²+a²) = √(3a²) = a√3. This is approximately 1.732 times the side length. For example, a 12-inch cube can contain a rod up to 12√3 ≈ 20.78 inches long. This √3 factor is a fundamental constant for all cubes regardless of size.
How do you find the space diagonal of a hexagonal prism?
For a regular hexagonal prism with side length s and height h, the longest internal diagonal connects two vertices on opposite ends of the hexagon at opposite ends of the prism. The distance between opposite vertices of a regular hexagon equals 2s (the diameter). Therefore, the space diagonal is d = √((2s)²+h²) = √(4s²+h²). This derivation uses the same 2D-to-3D Pythagorean extension as the rectangular case.
If I know the diagonal and two dimensions, how do I find the third?
Rearrange the space diagonal formula: h = √(d²−l²−w²). For example, if d=25, l=15, w=12, then h = √(625−225−144) = √256 = 16. This is useful in packaging design when you know the diagonal constraint (rod length) and two box dimensions and need to find the minimum required third dimension.
Is the longest rod that fits in a cylinder equal to the space diagonal of its bounding box?
No. For a cylinder of radius r and height h, the longest rod fits along the diameter at an angle, giving length d = √((2r)²+h²). This is smaller than the space diagonal of its bounding box (√(4r²+4r²+h²) = √(8r²+h²)) because the cylinder has round cross-sections that exclude the corners present in the bounding box. A box can always accommodate a longer rod than a same-sized cylinder.
Can you tilt a rod longer than the space diagonal to fit it inside a box?
No. The space diagonal is a provable maximum — it is the longest chord of the rectangular prism. No matter how you orient a straight rigid rod inside the box, it cannot exceed d = √(l²+w²+h²) in length. This is because the prism is a convex body, and the diameter of a convex body (the maximum chord) equals the maximum of all pairwise vertex distances, which for a rectangular prism is always the space diagonal.
All Prism Calculators & Step-by-Step Guides
Browse every specialized 3D prism calculator, formula derivation tool, and high school geometry worksheet solution guide available on our platform.
Prism Shapes (6) All Geometries
Volume & Capacity (7) V = B · h
Height & Diagonals (5) Inverse Solvers
Surface & Lateral Area (14) SA = 2B + Ph
- Total Surface Area Solver
- Lateral Area Calculator
- Rectangular Surface Area
- Rectangular Lateral Area
- Cube Surface Area Calculator
- Cube Lateral Area Calculator
- Triangular Surface Area
- Triangular Lateral Area
- Trapezoidal Surface Area
- Trapezoidal Lateral Area
- Hexagonal Surface Area
- Hexagonal Lateral Area
- Pentagonal Surface Area
- Pentagonal Lateral Area
Base Area & Perimeter (14) Cross-Sections
- Base Area Calculator
- Perimeter & Wireframe
- Rectangular Base Area
- Rectangular Perimeter
- Cube Base Area Calculator
- Cube Perimeter Calculator
- Triangular Base Area
- Triangular Perimeter
- Trapezoidal Base Area
- Trapezoidal Perimeter
- Hexagonal Base Area
- Hexagonal Perimeter
- Pentagonal Base Area
- Pentagonal Perimeter
Specialized & Optics Solvers (6) Industry Tools
Worksheet Solutions & Guides Kuta Worksheets
- Geometry Guides & Solutions Hub →
- Octagonal Prism Net Layout (Measurements & Fabrication) →
- Triangular Prism Box Template (Packaging Dieline Generator) →
- Printable Hexagonal Prism Net Template (A4/Letter PDF) →
- Rectangular Prism Printable Templates (A4/Letter PDF) →
- Rectangular Prism Net with Measurements & Grid Generator →
- Rectangular Prism Net: 2D Layout & 3D Folding Guide →
- 10. Volume of Prisms and Cylinders – Solutions with Work →
- 10. Surface Area of Prisms and Cylinders – Solutions with Work →