Triangle Calculator Widget
Give geometry and trigonometry students a triangle solver. They choose what they know, enter three values (or two for a right triangle), and get every side and angle, the area by Heron's formula, the perimeter, the three heights and whether the triangle is acute, right or obtuse.
Live preview
Under the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/triangle-calculator" title="Triangle Calculator by A2Z Tools" width="100%" height="730" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="triangle-calculator" data-height="730"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
Side a is always opposite angle A, b opposite B and c opposite C, with angles in degrees. Three sides are first checked against the triangle inequality - 1, 2 and 3 lie flat, so they are refused with the reason - and the angles then come from the law of cosines. Two sides with the included angle use the cosine rule for the third side and continue as SSS. With two angles, the third is 180 minus their sum, and the sides follow from the law of sines using the side that was given. Right triangles use Pythagoras directly from two legs or from a leg and the hypotenuse. The area uses Heron's formula in Kahan's rearranged order, which stays accurate even for needle-thin triangles where the textbook form loses digits. The triangle is classified by sides (equilateral, isosceles, scalene) and by its largest angle. Two sides and a non-included angle (SSA) can describe two different triangles, so that ambiguous case is deliberately not offered.
Calculation method
- Law of cosines: cos A = (b^2 + c^2 - a^2) / 2bc; c^2 = a^2 + b^2 - 2ab cos C
- Law of sines: a / sin A = b / sin B = c / sin C
- Heron: s = (a + b + c) / 2, area = sqrt(s(s - a)(s - b)(s - c))
- Height to side a = 2 x area / a
Worked examples
The 3-4-5 right triangle
Inputs: SSS: 3, 4, 5
Result: Area 6, perimeter 12, scalene right; A = 36.8699, B = 53.1301
3^2 + 4^2 = 5^2, so C is exactly 90 degrees.
Two sides and the angle between
Inputs: SAS: a = 5, b = 7, C = 60
Result: c = 6.245, area 15.1554
c^2 = 25 + 49 - 70 x 0.5 = 39; area = 0.5 x 5 x 7 x sin 60.
Limitations
- The ambiguous SSA case is not solved.
- Angles in degrees only; radians and gradians are not accepted.
- Plane triangles only - spherical triangles on the Earth's surface need different formulas.
Where publishers use it
- Trigonometry lessons on the sine and cosine rules
- Carpentry and roofing guides working out rafter lengths and angles
- Land-survey and plot-area explanations for triangular parcels
- Physics pages resolving forces in a triangle of vectors
- Exam-practice sites where students check worked answers
Questions
Why is the SSA case missing?
Two sides and an angle that is not between them can fit two different triangles, one or none. For example a = 6, b = 8 and A = 40 degrees gives B of about 59 or 121 degrees. Re-measure the included angle or a third side instead.
Which side is a?
The labels follow the standard convention: side a is opposite angle A, b opposite B, c opposite C. In right-triangle modes c is the hypotenuse and the right angle is C.
How is the area found?
By Heron's formula from the three sides. A 3-4-5 triangle has s = 6 and area sqrt(6 x 3 x 2 x 1) = 6, the same as half of base times height.
Why do 1, 2 and 3 not make a triangle?
The two shorter sides must add up to more than the longest. 1 + 2 equals 3, so the points lie on one straight line with zero area.
What units should I use?
Any single length unit for all sides; the area is in that unit squared. Angles are always entered and shown in degrees.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Triangle Calculator https://a2z.tools/embed/triangle-calculator
<a href="https://a2z.tools/embed/triangle-calculator">A2Z Tools Triangle Calculator</a>
[A2Z Tools Triangle Calculator](https://a2z.tools/embed/triangle-calculator)
Triangle Calculator by A2Z Tools - https://a2z.tools/embed/triangle-calculator
Related widgets
-
Trig in degrees or radians, logs, roots, powers, factorials, pi, e and Ans - typed or tapped.
-
Volume and surface area of nine solids, from cube to capsule, in cubic units, litres and gallons.
-
Real or complex roots of ax^2 + bx + c = 0, with the discriminant, vertex and axis of symmetry.
-
X% of Y, X as a percent of Y, and the percentage change between two values.
-
A clean on-screen calculator with keyboard support, correct operator precedence and percent.
-
Add, subtract, multiply and divide fractions and mixed numbers, with the simplified answer.