How this instrument works
Draw a rectangle's diagonal and it slices the shape into two identical right triangles, with width and height standing in as the two legs. The angle this calculator reports, θ, sits in the corner where the diagonal leaves that first side — height is the leg opposite the angle and width the leg adjacent to it, so tan θ is simply their ratio. Reversing the division, atan, hands the angle straight back: θ = atan(height ⁄ width) is nothing more exotic than reading a slope off two known legs.
That ratio is the whole story, and it produces a genuinely surprising consequence: θ depends only on the shape of the rectangle, never its size. A business card and a barn door share the identical diagonal angle the moment their width-to-height ratio matches, because doubling, tripling, or shrinking both sides by the same factor leaves height ⁄ width completely unchanged. Paper sizes, screen aspect ratios, and door panels all carry a fixed diagonal angle for exactly this reason, independent of how large the actual object is built.
The formula also behaves sensibly at its extremes. Make the two sides equal and θ lands on exactly 45°, splitting the rectangle's square corner in half by symmetry. Shrink height toward zero against a fixed width and the diagonal collapses toward that same side, so θ creeps toward 0°; shrink the horizontal side instead and the diagonal swings up toward vertical, pushing θ toward 90°. And because a rectangle's two width sides are parallel to each other, the same angle θ reappears, unchanged, where that diagonal meets the far corner — a genuine consequence of alternate interior angles cut across a transversal.
- Enter the rectangle's horizontal side into the Width field.
- Enter the vertical side into the Height field, using the same unit of length as Width.
- Read Angle between diagonal and width for θ = atan(height ⁄ width), shown in degrees by default.
- Switch that field's unit to radians or turns if your next step needs one of those instead.
- To find the angle the diagonal makes with the height side instead, swap the Width and Height entries — the two results always add to exactly 90°.
Worked example — a 6-by-8 gate panel
A gate panel is framed 6 units wide and 8 units tall — enter Width = 6 and Height = 8. tan θ = 8 ⁄ 6 = 1.333333, and atan(1.333333) = 0.9272952180016122 radians, which the Angle field reports by default as 53.13010235415598°, rounding cleanly to about 53.13°. Those two sides, together with the diagonal, form the familiar 3-4-5 right triangle scaled up by two, so the diagonal itself runs exactly 10 units, though this sheet reports only the direction, not that length.
Frame the same panel at 60 by 80 units instead of 6 by 8, and Angle still reads 53.13010235415598° on the nose, because the ratio height ⁄ width has not moved even though every length just grew tenfold. A carpenter cutting a diagonal brace for either panel marks the identical angle at the saw, which is exactly the scale-invariance this formula guarantees — only the shape of the rectangle decides θ, never how big it is built.
Questions
What formula gives the angle between a rectangle's diagonal and its width?
θ = atan(height ⁄ width). Drawing the diagonal splits the rectangle into two right triangles where height is the leg opposite θ and width is the leg adjacent to it, so their ratio is tan θ by definition — arctan simply reverses that division and hands the angle back directly.
Why does doubling both the width and height leave the angle unchanged?
Because θ only depends on the ratio height ⁄ width, not on either length by itself. Scaling both sides by the same factor — doubling, halving, anything — leaves that ratio exactly where it was, so a rectangle and a larger copy built to the same proportions always share one identical diagonal angle.
Is finding this angle the same task as finding the diagonal's length?
No — they are two different coordinates for the same diagonal. Length, d = √(width² + height²), is how far the corner-to-corner line runs; this angle is the direction it runs in, measured from the width side. Together the pair describes the diagonal completely, the way a distance and a bearing together fix a line on a map.
What is the diagonal angle of a square?
Exactly 45°, every time, regardless of the square's size. Width and height are equal by definition in a square, so tan θ = 1, and atan(1) = 45° — the diagonal splits the square's right-angle corner perfectly in half, which is also why a square's two diagonals cross each other at right angles.
What is the most common mistake when computing this angle by hand?
Dividing the wrong side into the other. atan(height ⁄ width) and atan(width ⁄ height) are complementary, not equal — they sum to exactly 90°, so swapping the ratio silently swaps which corner angle comes back. For the 6-by-8 panel above, that mix-up would return 36.87° instead of the correct 53.13°.