# Triangle Calculator — Right Triangle and Any Triangle Solver

> Solve a right triangle from any two of rise, run, slope length and angle, or any triangle from three known parts: every side, every angle and the area.

Page: https://craftquantities.com/calculators/measurements-conversions/triangle-calculator/ (calculator). This is the page's Markdown copy; the HTML page is the canonical version.

Version 1.0.0, sources checked 2026-10-05, 14 published test vectors.

Missing side or area: 12.6 ft slope length for Rise 4 ft and Run 12 ft, the page's opening figures; on the metric page, 1.2 m and 3.6 m give 3.79 m slope length. Source: NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles.

## Inputs

A length, area or volume is entered with its unit. The page opens on the values below: a metric reader sees the metric column, a US customary reader the other.

| Input | id | Opens at (metric) | Opens at (US customary) | Accepts |
|---|---|---|---|---|
| What You Know | `solveFrom` | Right triangle: the rise and the run | Right triangle: the rise and the run | `rise-run`, `run-slope`, `rise-slope`, `run-angle`, `rise-angle`, `slope-angle`, `sss`, `sas`, `asa`, `aas`, `ssa` |
| Rise | `rrRise` | 1.2 m | 4 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Run | `rrRun` | 3.6 m | 12 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Run | `rlRun` | 3.6 m | 12 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Slope Length | `rlSlope` | 4 m | 13 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Rise | `hlRise` | 2.6 m | 8.5 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Slope Length | `hlSlope` | 4.2 m | 14 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Run | `raRun` | 3.6 m | 12 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Slope Angle (degrees) | `raAngle` | 30 | 30 | range 0.1–89.9 |
| Rise | `haRise` | 2.6 m | 8.5 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Slope Angle (degrees) | `haAngle` | 35 | 35 | range 0.1–89.9 |
| Slope Length | `laSlope` | 4.8 m | 15.5 ft | mm, cm, m, in, ft, yd; range 0.001–1000 m |
| Slope Angle (degrees) | `laAngle` | 45 | 45 | range 0.1–89.9 |
| Side a | `sssA` | 7 m | 23 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side b | `sssB` | 5 m | 16.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side c | `sssC` | 6 m | 19.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side b | `sasB` | 4 m | 13 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side c | `sasC` | 5 m | 16.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Angle A Between Them (degrees) | `sasAngleA` | 60 | 60 | range 0.1–179.9 |
| Angle B (degrees) | `asaAngleB` | 50 | 50 | range 0.1–179.9 |
| Angle C (degrees) | `asaAngleC` | 60 | 60 | range 0.1–179.9 |
| Side a Between Them | `asaA` | 6 m | 19.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Angle A (degrees) | `aasAngleA` | 40 | 40 | range 0.1–179.9 |
| Angle B (degrees) | `aasAngleB` | 60 | 60 | range 0.1–179.9 |
| Side a | `aasA` | 5 m | 16.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side a | `ssaA` | 4 m | 13 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Side b | `ssaB` | 5 m | 16.5 ft | mm, cm, m, in, ft, yd; range 0.001–10000 m |
| Angle A (degrees) | `ssaAngleA` | 40 | 40 | range 0.1–179.9 |

- **What You Know**: Pick the pair of values you have for a right triangle, or the three you have for any other.
- **Rise**: The vertical leg: how far the slope climbs over its run.
- **Run**: The horizontal leg: the plan distance the slope covers.
- **Run**: The horizontal leg, measured level.
- **Slope Length**: The hypotenuse: the length along the slope between the same two points.
- **Rise**: The vertical leg: the height the slope has to climb.
- **Slope Length**: The length along the slope, which sets how far out its base lands.
- **Run**: The horizontal leg under the slope.
- **Slope Angle (degrees)**: The angle between the run and the slope, at the base of the slope, in degrees.
- **Rise**: The vertical leg the slope has to climb.
- **Slope Angle (degrees)**: The angle the slope makes with the level, in degrees.
- **Slope Length**: The length of the sloping member between its two points.
- **Slope Angle (degrees)**: The angle between the member and the level, in degrees.
- **Side a**: One side; angle A is the corner opposite it.
- **Side b**: The second side; angle B faces it.
- **Side c**: The third side; angle C faces it.
- **Side b**: One of the two sides that meet at the known angle.
- **Side c**: The other side meeting at the known angle.
- **Angle A Between Them (degrees)**: The angle at the corner where sides b and c meet, in degrees.
- **Angle B (degrees)**: The angle at one end of the known side, in degrees.
- **Angle C (degrees)**: The angle at the other end of the known side, in degrees.
- **Side a Between Them**: The side joining the two known angles.
- **Angle A (degrees)**: The angle opposite the known side, in degrees.
- **Angle B (degrees)**: A second angle, at one end of the known side, in degrees.
- **Side a**: The known side, the one opposite angle A.
- **Side a**: The side opposite the known angle A.
- **Side b**: The other known side, which meets side c at angle A.
- **Angle A (degrees)**: The known angle, opposite side a and not between the two known sides, in degrees.

`rrRise` applies only when `solveFrom` is `rise-run`.
`rrRun` applies only when `solveFrom` is `rise-run`.
`rlRun` applies only when `solveFrom` is `run-slope`.
`rlSlope` applies only when `solveFrom` is `run-slope`.
`hlRise` applies only when `solveFrom` is `rise-slope`.
`hlSlope` applies only when `solveFrom` is `rise-slope`.
`raRun` applies only when `solveFrom` is `run-angle`.
`raAngle` applies only when `solveFrom` is `run-angle`.
`haRise` applies only when `solveFrom` is `rise-angle`.
`haAngle` applies only when `solveFrom` is `rise-angle`.
`laSlope` applies only when `solveFrom` is `slope-angle`.
`laAngle` applies only when `solveFrom` is `slope-angle`.
`sssA` applies only when `solveFrom` is `sss`.
`sssB` applies only when `solveFrom` is `sss`.
`sssC` applies only when `solveFrom` is `sss`.
`sasB` applies only when `solveFrom` is `sas`.
`sasC` applies only when `solveFrom` is `sas`.
`sasAngleA` applies only when `solveFrom` is `sas`.
`asaAngleB` applies only when `solveFrom` is `asa`.
`asaAngleC` applies only when `solveFrom` is `asa`.
`asaA` applies only when `solveFrom` is `asa`.
`aasAngleA` applies only when `solveFrom` is `aas`.
`aasAngleB` applies only when `solveFrom` is `aas`.
`aasA` applies only when `solveFrom` is `aas`.
`ssaA` applies only when `solveFrom` is `ssa`.
`ssaB` applies only when `solveFrom` is `ssa`.
`ssaAngleA` applies only when `solveFrom` is `ssa`.

## The answer on the opening values

Worked exactly as the page works it, on the values each system opens on.

### Metric

| Result | Value |
|---|---|
| **Missing side or area** | 3.79 m slope length |
| Rise, side a | 1.2 m |
| Run, side b | 3.6 m |
| Slope length, side c | 3.79 m |
| Slope angle at the base, angle A | 18.43 ° |
| Angle at the top, angle B | 71.57 ° |
| Rise over run | 33.33 % |
| Area | 2.16 m² |
| Perimeter | 8.59 m |

### US customary

| Result | Value |
|---|---|
| **Missing side or area** | 12.6 ft slope length |
| Rise, side a | 4 ft |
| Run, side b | 12 ft |
| Slope length, side c | 12.65 ft |
| Slope angle at the base, angle A | 18.43 ° |
| Angle at the top, angle B | 71.57 ° |
| Rise over run | 33.33 % |
| Area | 24 sq ft |
| Perimeter | 28.65 ft |

## How it is worked out

Rise and run fix the triangle: the slope length is the square root of the two squared and added, and the slope angle is the one whose tangent is rise over run. A common rafter's run and rise give its line length this way, a flight's total rise and total going give the stringer, and a frame's height and width give the brace across it.

The working the page shows, in order: Rise, side a; Run, side b; Slope length, side c; Slope angle at the base, angle A; Angle at the top, angle B; Rise over run; Area; Perimeter; then missing side or area.

The method, derived in full:

- [Slope, Pitch and True Surface Area](https://craftquantities.com/methodology/slope-pitch-and-true-area/): Converting a plan footprint into the sloped area a roof actually has — the factor that decides whether a shingle order is right or a third short.

What this calculation does not cover:

- This is plane geometry: every side is a straight line on a flat surface. A tape laid down a slope measures the slope and not the plan distance, so a triangle meant for a plan, a plot or a slab needs horizontal measurements — stepped down the slope or taken along a level line — or the figures describe a different triangle from the one being set out.
- A right triangle takes exactly two values. Knowing a third does not make the answer better, it makes a check: solve from the two you trust most and compare the third with what the page returns, because a disagreement is a measuring error somewhere.
- Angles are typed in decimal degrees. A reading in degrees and minutes has to be converted first — thirty degrees and fifteen minutes is 30.25 — and a roof pitch given as a rise per unit of run belongs on the rise and run fields, not in an angle box.
- The lengths are line lengths between points, not cut lengths. A rafter's line runs from the ridge's centre line to the outside of the wall plate; the ridge deduction — half the ridge's thickness, measured square to the ridge — the overhang and the seat cut all come afterwards and are worked on the rafter pages, and a stringer's cutting length depends on how its ends are detailed.
- Small angular errors grow with distance. One degree off over 10 m (33 ft) moves the far end about 175 mm (7 in), so an angle that sets out a long line wants measuring as carefully as the lengths, and a long triangle is better fixed by its three sides than by an angle.
- Values that cannot make a triangle are not repaired. The page returns zero with the reason and the amount by which the figures miss, rather than guessing which of them was meant.

## Sources

As the calculator cites them (sources checked 2026-10-05):

- NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles: the right-triangle ratios sin A = a/c, cos A = b/c and tan A = a/b (4.42.1–4.42.3), the law of sines (4.42.4), the law of cosines c² = a² + b² − 2ab cos C (4.42.5), and the area ½bc sin A = √(s(s − a)(s − b)(s − c)) with s the semi-perimeter (4.42.7) <https://dlmf.nist.gov/4.42>
- Euclid, Elements, Book I (D. E. Joyce's edition, Clark University): Proposition 47, the square on the side opposite the right angle equals the squares on the other two sides together; Proposition 32, the three angles of a triangle together make two right angles; Proposition 20, any two sides of a triangle together are greater than the third <https://mathcs.clarku.edu/~djoyce/elements/bookI/propI47.html>
- OpenStax, Algebra and Trigonometry 2e (Rice University), §10.1 Non-right Triangles: Law of Sines — two sides and a non-included angle (SSA) may give no triangle, one right triangle, one triangle or two triangles; the area of an oblique triangle is half the product of two sides and the sine of the angle between them <https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines>
- DeWALT Rafter Square (DWHT46031) instruction manual: rafter lengths from the tables are to the centre of the ridge, so half the ridge board's thickness is deducted from the listed length before the top plumb cut is made, measured at right angles to the top plumb cut line and marked parallel to it; the worked example takes the run as half of a 20 ft building's width <https://assets.dewalt.com/GLOBALBOM/QU/DWHT46031/all/Instruction_Manual/EN/DWHT46031_RafterSquare.pdf>

A code or standard has force only where a jurisdiction has adopted it, usually with local amendments; check what is in force with the authority where you build.

## Questions answered on the page

**Why can two sides and an angle give two different triangles?**

Because the angle is at the wrong corner to pin anything down. Picture side b running out from the known angle A along one line, and side a hanging from its far end, free to swing. If side a is shorter than the perpendicular from that end to the other line — the height b × sin A — it never reaches. If it is exactly that height, it meets the line square, once. If it is longer than the height but shorter than side b, it reaches the line at two points, one each side of the foot of the perpendicular, and both make a valid triangle with the same three given values. If it is at least as long as side b, the nearer crossing falls behind the corner and only one triangle is left. The page works out which case you are in and, when there are two, shows both, because guessing would be a coin toss with a cut timber riding on it.

**How do I use this for a rafter, a stair stringer or a brace?**

Each is the slope of a right triangle. For a common rafter, the run is half the span, from the outside of the wall plate to the ridge's centre line, and the rise is the height the line climbs over that run; the slope length is then the line length to the centre line, and angle A is the pitch. Half the ridge's thickness comes off that length before the top cut is marked, measured square to the ridge — at right angles to the top plumb line — as the rafter-square makers' tables assume; never shorten the run and keep the full rise, which tilts the pitch. For a stringer, enter the total rise and the total going; the slope length is the stringer's line and angle A the pitch of the flight. For a brace across a frame or a gate, the rise and run are the height and width between the brace's ends. Where the job has its own page — the common rafter, the stair or the hip and valley calculators — use that for the cutting detail, and this one for any combination of figures those pages do not take.

**Can I measure the area of an awkward plot with it?**

Yes, by triangulation, which needs nothing but a tape. Split the plot into triangles from one corner, peg each corner, tape every side of every triangle on the level, and enter each triangle's three sides; the areas add up to the plot's. Keep the triangles as close to equilateral as the shape allows, because a long thin triangle magnifies any taping error in its area. For a plot with many corners or curved edges, the offsets-and-coordinates calculator does the same job in one pass.

**Which side is a, which is b and which is c?**

Each angle carries the letter of the side opposite it: angle A faces side a, and so on. For a right triangle this page fixes the names so the builder's words fit: a is the rise, b is the run, c is the slope, C is the right angle and A is the angle at the base of the slope. For any other triangle you can name the sides in whatever order is convenient, as long as each angle you enter faces the side with its letter.

**Why does the page sometimes say the triangle is flat, or impossible?**

Because some sets of numbers do not make a triangle and it would be wrong to pretend otherwise. Three sides close only if the longest is shorter than the other two together; equal, and the three points sit on one straight line with no area, which the page reports as flat. Two angles that add up to 180 degrees or more leave nothing for the third. A run or rise longer than its slope, or an SSA side too short to reach, cannot close either. In each case the answer is zero and a row says by how much the figures miss, which usually points straight at the measurement that was mis-read.

**How exact do the angles need to be?**

More exact than most people expect over any distance. The far end of a line moves sideways by about its length times the angle error in radians, so a single degree over 10 m (33 ft) is roughly 175 mm (7 in). That is why setting out favours lengths over angles: a triangle fixed by three taped sides is far less sensitive than one fixed by an angle read off a protractor, and the squaring and diagonal pages use lengths for the same reason.

## Related calculators

- [Common Gable Rafter Length Calculator](https://craftquantities.com/calculators/materials-quantities/common-rafter-length-calculator/)
- [Stair Rise & Run Calculator](https://craftquantities.com/calculators/renovation-construction/stair-calculator/)
- [Squaring Calculator for Layout and Setting Out (3-4-5 Rule)](https://craftquantities.com/calculators/measurements-conversions/layout-squaring-calculator/)
- [Irregular Area Calculator (Offsets and Coordinates)](https://craftquantities.com/calculators/measurements-conversions/irregular-area-offsets-coordinates-calculator/)

## Run it from a program

- REST: `GET https://api.craftquantities.com/v1/calculate/triangle-calculator` with each input as a query parameter, a length, area or volume with its unit; `https://api.craftquantities.com/v1/describe/triangle-calculator` lists the inputs.
- MCP: the `calculate` tool at https://api.craftquantities.com/mcp with `slug` `triangle-calculator`.
- Definition and test vectors: https://craftquantities.com/api/v1/calculators/triangle-calculator.json

---
Source: https://craftquantities.com/calculators/measurements-conversions/triangle-calculator/
Craft Quantities: free to read, cite and link to; the pages are not licensed for republication. Quantities only: no prices, no design and no certification.
