Calculator Form
Use the responsive grid below. Large screens show three columns, smaller screens show two, and mobile shows one.
Example Data Table
| Mode | Sample Inputs | Result | Formula Used |
|---|---|---|---|
| Rectangle | Length = 5 m, Width = 12 m | 13.000 m | d = √(l² + w²) |
| Square | Side = 9 cm | 12.728 cm | d = s√2 |
| Cuboid | Length = 3 m, Width = 4 m, Height = 12 m | 13.000 m | d = √(l² + w² + h²) |
| Cube | Side = 8 ft | 13.856 ft | d = a√3 |
| Parallelogram | a = 10 m, b = 6 m, θ = 60° | Shorter = 8.718 m, Longer = 14.000 m | d₁, d₂ from cosine relationships |
| Regular Polygon | n = 6, side = 4 m, step = 2 | 6.928 m | d = a × sin(kπ/n) ÷ sin(π/n) |
Formula Used
Rectangle
d = √(l² + w²)
Use this for any rectangle or screen-like shape when length and width are known.
Square
d = s√2
A square is a special rectangle with equal sides, so the diagonal follows directly from the Pythagorean relationship.
Cuboid
d = √(l² + w² + h²)
This calculates the full space diagonal connecting opposite corners inside a rectangular box.
Cube
d = a√3
A cube is a special cuboid where all sides are equal.
Parallelogram
d₁ = √(a² + b² − 2abcosθ)
d₂ = √(a² + b² + 2abcosθ)
These formulas use the included angle between adjacent sides.
Regular Polygon
d = a × sin(kπ/n) ÷ sin(π/n)
Here, a is side length, n is the number of sides, and k is the chosen vertex step.
How to Use This Calculator
- Select the shape or calculation mode that matches your problem.
- Choose an input unit and your preferred output unit.
- Enter the required dimensions for the selected shape.
- Set the decimal precision for the displayed answer.
- Click Calculate Diagonal to view the result above the form.
- Review the summary table and the Plotly graph for quick comparison.
- Use the CSV button to save numeric results for spreadsheets.
- Use the PDF button to save a clean report for records or sharing.
FAQs
1. What does this calculator actually compute?
It computes diagonals for several shapes, including rectangles, squares, cuboids, cubes, parallelograms, and regular polygons. It also converts units, controls decimal precision, and shows a comparison graph for the final values.
2. What is the difference between a plane diagonal and a space diagonal?
A plane diagonal lies on a flat surface, such as a rectangle or square. A space diagonal passes through a three-dimensional solid, such as a cuboid or cube, connecting opposite corners inside the shape.
3. Why are there two diagonals in a parallelogram?
A parallelogram has two corner-to-corner connections. When the angle is not a right angle, those diagonals usually have different lengths. The calculator returns both the shorter and the longer diagonal for clarity.
4. What does vertex step mean in the polygon mode?
Vertex step tells the calculator how many vertices apart the two connected corners are. A step of 2 gives the nearest diagonal, while larger values create longer diagonals in the same regular polygon.
5. Can I use different input and output units?
Yes. You can enter values in one unit and display the result in another. This is useful when dimensions are measured in centimeters, but your final report needs meters, feet, or inches.
6. Why does the graph compare dimensions with the diagonal?
The graph helps you quickly see how the diagonal relates to the entered sides. It is especially useful for teaching, checking design proportions, and comparing the final result against original dimensions.
7. Is this calculator suitable for school and technical work?
Yes. It is useful for homework, geometry lessons, drafting, packaging, construction estimates, and screen-size checks. Still, always verify measurement assumptions when using results in engineering or fabrication work.
8. Why do I get a validation message?
Validation appears when a required value is missing, zero, negative, or outside an allowed range. Examples include polygon sides below four or an included angle outside 0 to 180 degrees.