Math

Triangle Calculator

Solve any triangle by entering 3 known values. Calculate all sides, angles, area, and perimeter using the law of sines and law of cosines.

Quick Answer

Enter any 3 known measurements (sides a, b, c or angles A, B, C or area) and this calculator solves for all remaining values. Uses the law of cosines (c² = a² + b² - 2ab cos C) and law of sines (a/sin A = b/sin B = c/sin C).

Enter Known Values

Provide at least 3 values. Leave unknown fields blank. Angles are in degrees.

Sides

Angles (degrees)

Area (optional known)

Solution

Method: SSS (three sides)

Side a
5
Side b
7
Side c
10
Angle A
27.6604°
Angle B
40.5358°
Angle C
111.8037°
Area
16.2481
Perimeter
22

Triangle Diagram

c = 10b = 7a = 5

About This Tool

The Triangle Calculator is a comprehensive tool that solves any triangle when you provide at least three known measurements. Whether you know three sides (SSS), two sides and an included angle (SAS), two angles and a side (ASA or AAS), or even a combination involving the area, this calculator determines all remaining sides, angles, the area, and the perimeter. It is an essential resource for students learning trigonometry, engineers designing structures, surveyors measuring land, and anyone who works with triangular geometry.

How the Law of Cosines Works

The law of cosines generalizes the Pythagorean theorem to all triangles. It states that c² = a² + b² - 2ab cos(C), where C is the angle opposite side c. When C is 90 degrees, cos(C) = 0, and the formula reduces to the Pythagorean theorem. This law is particularly useful when you know all three sides (SSS) and need to find the angles, or when you know two sides and the included angle (SAS) and need to find the third side. The law of cosines is derived from the distance formula and vector dot products, making it a cornerstone of both planar and spherical trigonometry.

How the Law of Sines Works

The law of sines states that a/sin(A) = b/sin(B) = c/sin(C), meaning the ratio of each side to the sine of its opposite angle is constant for any triangle. This constant equals the diameter of the triangle's circumscribed circle (circumradius). The law of sines is ideal for ASA and AAS cases. However, the SSA case (two sides and a non-included angle) can be ambiguous because the sine function can yield two possible angles, potentially producing two valid triangles. This calculator handles the primary solution for the ambiguous case.

Triangle Area Formulas

There are many ways to calculate a triangle's area. The most basic is A = (1/2) base x height. When you know two sides and the included angle, the formula A = (1/2)ab sin(C) is very efficient. When you know all three sides, Heron's formula uses the semi-perimeter s = (a+b+c)/2 to compute A = sqrt(s(s-a)(s-b)(s-c)). Each method has its place depending on what information is available, and this calculator selects the appropriate formula automatically based on your inputs.

Types of Triangles

Triangles are classified by their sides and angles. An equilateral triangle has all three sides equal and all angles 60 degrees. An isosceles triangle has exactly two equal sides and two equal base angles. A scalene triangle has no equal sides. By angle, a triangle can be acute (all angles less than 90 degrees), right (one angle exactly 90 degrees), or obtuse (one angle greater than 90 degrees). Understanding triangle classification helps verify results and provides geometric intuition for many practical applications, from architecture to navigation.

Real-World Applications

Triangle calculations are fundamental in surveying, where triangulation is used to determine distances to inaccessible points. In construction and engineering, triangles provide structural rigidity (truss bridges, roof trusses). Navigation systems use triangulation from satellite signals (GPS). Computer graphics rely on triangle meshes to render 3D objects. Even astronomy uses parallax triangles to measure star distances. This calculator makes these calculations instant, replacing tedious manual trigonometric computation with accurate, step-by-step results.

Frequently Asked Questions

What is the minimum information needed to solve a triangle?
You need at least three independent pieces of information, and at least one must be a side length. Three angles alone (AAA) determine the shape but not the size, so infinite similar triangles would satisfy those angles. Valid combinations include SSS, SAS, ASA, AAS, and SSA (with caveats about the ambiguous case).
What is the ambiguous case (SSA) in triangle solving?
When you know two sides and an angle opposite one of them (SSA), there may be zero, one, or two valid triangles. This happens because the sine function gives the same value for supplementary angles. For example, sin(30) = sin(150) = 0.5. This calculator returns the primary solution, but be aware a second triangle may exist when using SSA inputs.
Why must the three angles of a triangle sum to 180 degrees?
This is a fundamental theorem of Euclidean geometry. It can be proven by drawing a line through one vertex parallel to the opposite side. The alternate interior angles formed equal the other two angles of the triangle, and together with the vertex angle they form a straight line (180 degrees). This property only holds in flat (Euclidean) geometry; on a sphere, angles sum to more than 180 degrees.
What is Heron's formula and when should I use it?
Heron's formula calculates the area of a triangle when you know all three side lengths: A = sqrt(s(s-a)(s-b)(s-c)), where s = (a+b+c)/2 is the semi-perimeter. It is attributed to Hero of Alexandria (1st century AD). Use it when you know SSS and need the area without first calculating angles. It is numerically stable and efficient for computational applications.
Can this calculator handle right triangles?
Yes. A right triangle is simply a triangle with one 90-degree angle. You can enter the 90-degree angle and two sides, or three sides where one satisfies the Pythagorean theorem. The calculator will solve it using the same law of cosines and law of sines methods, which naturally handle right triangles as a special case.
How accurate are the results?
The calculator uses JavaScript floating-point arithmetic (64-bit double precision), which provides approximately 15-16 significant digits of precision. Results are displayed rounded to 4 decimal places. For most practical applications in engineering, surveying, and education, this level of precision far exceeds requirements.

Was this tool helpful?