Enter the three values you know out of the sides a, b, c and the angles A, B, C (in degrees). At least one must be a side. Side a is across from angle A, side b from angle B, and side c from angle C.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Angle sum of a triangle
-
Law of cosines (third side from two sides and the included angle)
-
Law of sines (the bridge between sides and opposite angles)
-
Area (two sides and the included angle)
-
Heron's formula (area from three sides)
-
Radius of the inscribed circle (inradius)
-
Radius of the circumscribed circle (circumradius)
-
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter any three of the sides \(a, b, c\) and the angles \(A, B, C\) that you know (at least one must be a side), and get all the other sides and angles
- Also finds the area, the perimeter, the semiperimeter, the three heights, the three medians, the inradius and the circumradius, all at once
- Automatically tells you the type of triangle: equilateral, isosceles or scalene, and acute, right or obtuse
- When two sides and an angle opposite one of them (SSA) allow two different triangles, both solutions are shown (the well-known "ambiguous case")
- A plain-language explanation of the law of cosines, the law of sines and Heron's formula, and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
You can find the distance to a landmark across a river without stretching a tape measure over the water. Lay out a 300-foot baseline on your side and measure the angle to the landmark from each end. That gives a triangle with one side (300 feet) and two angles. If the angles are 50° and 60°, the third angle is 70°, and the law of sines gives the distance to the landmark as \(300 \times \sin 50^\circ \div \sin 70^\circ \approx 244.6\) feet.
The total stations that surveyors use, and the triangulation that mapmaking was built on, come down to repeating this very calculation.
For a triangular piece of land, you can find the area with just a tape measure, without any tool for measuring angles. If the three sides are 90 feet, 120 feet and 150 feet, the semiperimeter is 180 feet and the area is \(\sqrt{180 \times 90 \times 60 \times 30} = 5{,}400\) square feet (about 0.12 acre).
"Anyone can measure lengths accurately" is why Heron's formula has been popular in practice, and it is still handy for a rough check of the area of farmland or a building lot.
Buildings are full of slanted parts: roof slopes, stairs, diagonal braces and so on. For a shed roof that runs 12 feet across and rises 5 feet, the length of the slope is \(\sqrt{12^2 + 5^2} = 13\) feet (with a right angle, the correction term of the law of cosines disappears, leaving the Pythagorean theorem).
If you work out the lengths and angles before cutting the lumber, you waste less material and redo less work on site.
A factory robot arm is itself a triangle: two arm links and the joint angle between them. With links of 20 inches and 12 inches and the joint opened to 120°, the law of cosines gives the distance from the base to the hand as \(\sqrt{20^2 + 12^2 - 2 \times 20 \times 12 \times \cos 120^\circ} = 28\) inches.
Working backward to the joint angles that move the hand to a target position (inverse kinematics) also uses a rearranged law of cosines as a basic building block.
The distance to a star is measured with a very long, thin triangle whose base is the distance the Earth moves in half a year of its orbit around the Sun (this is called stellar parallax). Finding the distance from the base and the small shift in angle is the same idea as this page's "find the rest from one side and angles" calculation.
"If you can solve a triangle, you can find the distance to a place you cannot go." This works from land surveying all the way to outer space, and it is one of the most powerful uses of geometry.
Formulas and figures
Symbols and terms
Symbols
| \(a, b, c\) | a, b, c (lowercase) | The lengths of the three sides of the triangle. By custom, each side uses the lowercase of the letter of the angle across from it (side a is opposite angle A). |
| \(A, B, C\) | A, B, C (uppercase) | The three angles of the triangle (in degrees). They always add up to 180°. |
| \(S\) | S | The area of the triangle. (Some US textbooks use \(K\) or \(A\) for area instead.) |
| \(s\) | s (lowercase) | The semiperimeter, half the perimeter (\(a+b+c\)). It is used in Heron's formula and in the formula for the inradius. |
| \(\sin\theta\) | sine theta | One of the trig ratios. In a right triangle, it is the height as a fraction of the hypotenuse, and it is used to get the vertical part from an angle. \(\sin 30^\circ = 0.5\) and \(\sin 90^\circ = 1\). |
| \(\cos\theta\) | cosine theta | One of the trig ratios. In a right triangle, it is the base as a fraction of the hypotenuse. \(\cos 60^\circ = 0.5\) and \(\cos 90^\circ = 0\). The "cosines" in the law of cosines is this function. |
| \(r\) | r (lowercase) | The radius of the incircle (the circle that touches all three sides from the inside). |
| \(R\) | R (uppercase) | The radius of the circumcircle (the circle through all three vertices). |
Terms
| opposite side | The side across from an angle is called the opposite side of that angle. On this page, side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C. |
| opposite angle | The angle across from a side is called the opposite angle of that side. On this page, angle A is opposite side a, angle B is opposite side b, and angle C is opposite side c. |
| angle sum | The fact that the three angles of a triangle always add up to 180° (the triangle angle sum theorem). If you know two angles, the third is found by subtraction. |
| triangle inequality | The condition for three lengths to form a triangle - the sum of any two sides must be greater than the third side. For example, 1, 2 and 4 do not form a triangle because 1 + 2 = 3 is less than 4. |
| law of cosines | The rule \(c^2 = a^2 + b^2 - 2ab\cos C\) for finding the third side from two sides and the included angle. It extends the Pythagorean theorem to triangles without a right angle, and rearranged, it gives an angle from three sides. It is taught in high school (Geometry or Precalculus). |
| law of sines | The rule that "side ÷ sine of its opposite angle" is the same for all three pairs and equals the diameter \(2R\) of the circumcircle. Once you know one side and its opposite angle, it bridges to the other sides and angles. It is taught in high school (Geometry or Precalculus). |
| Heron's formula | A formula that gives the area from the three side lengths alone, without any angle. It is named after Heron of Alexandria, an ancient Greek mathematician. |
| semiperimeter | Half the perimeter of a triangle. It appears in Heron's formula and in the formula for the inradius. |
| incircle | The inscribed circle, which touches all three sides of the triangle from the inside. Its center (the incenter) is where the three angle bisectors meet. |
| circumcircle | The circumscribed circle, which passes through all three vertices of the triangle. Its center (the circumcenter) is where the perpendicular bisectors of the three sides meet. |
| median | The segment from a vertex of a triangle to the midpoint of the opposite side. The three medians meet at one point (the centroid). |
| acute triangle | A triangle whose largest angle is less than 90°. By their angles, triangles are classified as acute, right or obtuse. |
| right triangle | A triangle whose largest angle is exactly 90°. By their angles, triangles are classified as acute, right or obtuse. |
| obtuse triangle | A triangle whose largest angle is greater than 90°. By their angles, triangles are classified as acute, right or obtuse. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
The angle sum and Heron's formula need only middle school math. The law of cosines and the law of sines are high school topics (Geometry or Precalculus).
| Angles of a triangle (Grades 4–8) |
|
| Square roots (Grade 8) |
|
| The Pythagorean theorem (Grade 8) |
|
| Right triangle trigonometry (Geometry) |
|
| The law of sines and the law of cosines (Geometry or Precalculus) |
|
How to calculate it in Excel
| Angle A (degrees) | 50 |
| Angle B (degrees) | 60 |
| Third angle C (degrees) | =180-B1-B2 |
| Side a | 5 |
| Side b | 7 |
| Included angle C (degrees) | 60 |
| Third side c | =SQRT(B1^2+B2^2-2*B1*B2*COS(RADIANS(B3))) |
| Side a | 6 |
| Its opposite angle A (degrees) | 45 |
| Angle B (degrees) | 60 |
| Side b | =B1*SIN(RADIANS(B3))/SIN(RADIANS(B2)) |
| Side a | 8 |
| Side b | 5 |
| Included angle C (degrees) | 30 |
| Area S | =B1*B2*SIN(RADIANS(B3))/2 |
| Side a | 3 |
| Side b | 4 |
| Side c | 5 |
| Semiperimeter s | =(B1+B2+B3)/2 |
| Area S | =SQRT(B4*(B4-B1)*(B4-B2)*(B4-B3)) |
| Area S | 6 |
| Semiperimeter s | 6 |
| Inradius r | =B1/B2 |
| Side a | 3 |
| Side b | 4 |
| Side c | 5 |
| Area S | 6 |
| Circumradius R | =B1*B2*B3/(4*B4) |
Excel's COS and SIN take angles in radians, so the RADIANS function is placed in between to convert degrees to radians. SQRT is the square root.
For example, in the second table, B4 shows about 6.245. Just replace the input numbers with your own values.
How to calculate it in Google Sheets
| Angle A (degrees) | 50 |
| Angle B (degrees) | 60 |
| Third angle C (degrees) | =180-B1-B2 |
| Side a | 5 |
| Side b | 7 |
| Included angle C (degrees) | 60 |
| Third side c | =SQRT(B1^2+B2^2-2*B1*B2*COS(RADIANS(B3))) |
| Side a | 6 |
| Its opposite angle A (degrees) | 45 |
| Angle B (degrees) | 60 |
| Side b | =B1*SIN(RADIANS(B3))/SIN(RADIANS(B2)) |
| Side a | 8 |
| Side b | 5 |
| Included angle C (degrees) | 30 |
| Area S | =B1*B2*SIN(RADIANS(B3))/2 |
| Side a | 3 |
| Side b | 4 |
| Side c | 5 |
| Semiperimeter s | =(B1+B2+B3)/2 |
| Area S | =SQRT(B4*(B4-B1)*(B4-B2)*(B4-B3)) |
| Area S | 6 |
| Semiperimeter s | 6 |
| Inradius r | =B1/B2 |
| Side a | 3 |
| Side b | 4 |
| Side c | 5 |
| Area S | 6 |
| Circumradius R | =B1*B2*B3/(4*B4) |
Copy the whole table, paste it into cell A1, and replace the input numbers with your own values.
How to calculate it in Python
import math
side_a = 3.0 # side a
side_b = 4.0 # side b
side_c = 5.0 # side c (example where all three sides are known)
# Find the three angles with the law of cosines solved for the angle (in degrees)
angle_a = math.degrees(math.acos((side_b**2 + side_c**2 - side_a**2) / (2 * side_b * side_c)))
angle_b = math.degrees(math.acos((side_a**2 + side_c**2 - side_b**2) / (2 * side_a * side_c)))
angle_c = 180 - angle_a - angle_b
# Area with Heron's formula
half_perimeter = (side_a + side_b + side_c) / 2
area = math.sqrt(half_perimeter * (half_perimeter - side_a)
* (half_perimeter - side_b) * (half_perimeter - side_c))
inradius = area / half_perimeter # radius of the inscribed circle
circumradius = side_a * side_b * side_c / (4 * area) # radius of the circumscribed circle
print(f"Angle A = {angle_a}°, angle B = {angle_b}°, angle C = {angle_c}°")
print(f"Area = {area}")
print(f"Inradius = {inradius}, circumradius = {circumradius}")
How to write it in LaTeX and other math languages (copy and paste)
A + B + C = 180°
A + B + C = 180^\circ
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>A</mi><mo>+</mo><mi>B</mi><mo>+</mo><mi>C</mi>
<mo>=</mo>
<mn>180</mn><mo>°</mo>
</mrow>
</math>
A + B + C = 180^@
angleA + angleB + angleC == 180
A + B + C = 180;
C = 180 - A - B;
A + B + C = 180°
c² = a² + b² − 2ab·cos C
c^{2} = a^{2} + b^{2} - 2ab\cos C
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup><mi>c</mi><mn>2</mn></msup>
<mo>=</mo>
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<msup><mi>b</mi><mn>2</mn></msup>
<mo>−</mo>
<mn>2</mn><mi>a</mi><mi>b</mi>
<mi>cos</mi><mo>⁡</mo><mi>C</mi>
</mrow>
</math>
c^2 = a^2 + b^2 - 2ab cos C
cSide = Sqrt[a^2 + b^2 - 2 a b Cos[angleC Degree]]
c := sqrt(a^2 + b^2 - 2*a*b*cos(C*Pi/180));
c = sqrt(a^2 + b^2 - 2*a*b*cosd(C));
c^2 = a^2 + b^2 - 2ab cos(C)
a/sin A = b/sin B = c/sin C = 2R
\dfrac{a}{\sin A} = \dfrac{b}{\sin B} = \dfrac{c}{\sin C} = 2R
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mfrac><mi>a</mi><mrow><mi>sin</mi><mo>⁡</mo><mi>A</mi></mrow></mfrac>
<mo>=</mo>
<mfrac><mi>b</mi><mrow><mi>sin</mi><mo>⁡</mo><mi>B</mi></mrow></mfrac>
<mo>=</mo>
<mfrac><mi>c</mi><mrow><mi>sin</mi><mo>⁡</mo><mi>C</mi></mrow></mfrac>
<mo>=</mo>
<mn>2</mn><mi>R</mi>
</mrow>
</math>
a/sin A = b/sin B = c/sin C = 2R
bSide = a Sin[angleB Degree]/Sin[angleA Degree]
b := a*sin(B*Pi/180)/sin(A*Pi/180);
b = a*sind(B)/sind(A);
a/sin(A) = b/sin(B) = c/sin(C) = 2R
S = (1/2)·ab·sin C
S = \frac{1}{2}ab\sin C
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>S</mi>
<mo>=</mo>
<mfrac><mn>1</mn><mn>2</mn></mfrac>
<mi>a</mi><mi>b</mi>
<mi>sin</mi><mo>⁡</mo><mi>C</mi>
</mrow>
</math>
S = 1/2 ab sin C
area = (1/2) a b Sin[angleC Degree]
S := (1/2)*a*b*sin(C*Pi/180);
S = a*b*sind(C)/2;
S = (1/2)ab sin(C)
s = (a+b+c)/2, S = √(s(s−a)(s−b)(s−c))
s = \frac{a+b+c}{2}, \quad S = \sqrt{s(s-a)(s-b)(s-c)}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>S</mi>
<mo>=</mo>
<msqrt>
<mi>s</mi>
<mo>(</mo><mi>s</mi><mo>−</mo><mi>a</mi><mo>)</mo>
<mo>(</mo><mi>s</mi><mo>−</mo><mi>b</mi><mo>)</mo>
<mo>(</mo><mi>s</mi><mo>−</mo><mi>c</mi><mo>)</mo>
</msqrt>
</mrow>
</math>
S = sqrt(s(s-a)(s-b)(s-c))
area = Sqrt[s (s - a) (s - b) (s - c)] /. s -> (a + b + c)/2
s := (a+b+c)/2; S := sqrt(s*(s-a)*(s-b)*(s-c));
s = (a+b+c)/2; S = sqrt(s*(s-a)*(s-b)*(s-c));
S = √(s(s-a)(s-b)(s-c))
r = S/s
r = \dfrac{S}{s}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>r</mi>
<mo>=</mo>
<mfrac><mi>S</mi><mi>s</mi></mfrac>
</mrow>
</math>
r = S/s
inradius = area/s
r := S/s;
r = S/s;
r = S/s
R = abc/(4S)
R = \dfrac{abc}{4S}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi>
<mo>=</mo>
<mfrac>
<mrow><mi>a</mi><mi>b</mi><mi>c</mi></mrow>
<mrow><mn>4</mn><mi>S</mi></mrow>
</mfrac>
</mrow>
</math>
R = (abc)/(4S)
circumradius = a b c/(4 area)
R := a*b*c/(4*S);
R = a*b*c/(4*S);
R = abc/(4S)
How to have ChatGPT do the calculation
You are a calculation assistant for triangles. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). In a triangle, side a = 7, side b = 10 and angle A = 40° (angle A is the angle opposite side a). 1. Use the law of sines to find angle B. Note that with these conditions there may be two possible triangles (the ambiguous case). If there are two solutions, show both. 2. For each solution, find the remaining angle C, side c and the area. Show the formulas you used and the numbers from the execution result in a table.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
