Triangle Side Calculator - Law of Cosines and Law of Sines
Use this triangle side calculator to recover the missing side of any triangle from two sides and an included angle, or from one side and two angles, in one form.
Triangle Side Calculator
Results
What Is Triangle Side Calculator?
A triangle side calculator recovers the missing side of a triangle when you already know enough of the other sides and angles. The form handles SAS (two sides plus the included angle) via the Law of Cosines, and AAS or ASA (one side plus two angles) via the Law of Sines. Type the known values and the calculator returns the missing side, the other sides, all three angles, and the perimeter.
- • Surveying a triangular plot: Measure two sides and the angle between them with a tape and a clinometer, then read the third side directly.
- • Cutting rafters and braces: Recover the third edge of a roof or frame triangle from the two edges you can measure on site and the corner angle you can lay out.
- • Checking a homework problem: Verify a hand calculation for a 3-4-5, 5-12-13, or any other textbook triangle by entering the given sides and angle.
Three pieces of data are enough to fix a Euclidean triangle. With two sides and the angle between them, the calculator applies the Law of Cosines. With one side and two angles, it completes the third angle and applies the Law of Sines. The same form swaps between cases via a single selector.
Enter side lengths in any positive unit and angles in degrees. The result is reported in the same length unit as the input sides, with no extra conversion step on the way to a drawing or cut list.
For the right-triangle special case where the two legs meet at 90 degrees, ABC triangle calculator handles the Pythagorean and trig ratios in one form.
How Triangle Side Calculator Works
The triangle side calculator picks one of two closed-form identities based on the case you select. SAS uses the Law of Cosines; AAS or ASA uses the Law of Sines. Both paths are pure algebraic formulas with no iteration.
- a, b, c: The three side lengths, with c the side opposite angle C and the side the calculator reports as the missing side.
- A, B, C: The three interior angles in degrees, with A + B + C = 180. In SAS mode you supply C; in AAS mode you supply A and B and the calculator recovers C.
- k = a / sin(A): The common ratio from the Law of Sines. Once you know k from one side-angle pair, every other side is k * sin(opposite angle).
The Law of Cosines works for any triangle, so the SAS path is the most general option when you can measure two sides and the angle between them. The Law of Sines is the right pick when you have an angle at each end of a side you can already measure; the calculator fills in the third angle and uses the common ratio k to recover the other two sides.
If your three pieces of data are three sides, the SSS case applies; the SSS triangle calculator handles that inverse problem.
Classic 3-4-5 right triangle (SAS)
Mode = SAS, side a = 3, side b = 4, included angle C = 90 degrees.
c = sqrt(3^2 + 4^2 - 2*3*4*cos(90 deg)) = sqrt(9 + 16 - 0) = sqrt(25) = 5.
Missing side c = 5.0000 units, angle A = 36.87 deg, angle B = 53.13 deg, perimeter = 12.0000 units.
This recovers the textbook right triangle, and the angles match the classic 3-4-5 result to two decimal places.
30-60 right triangle (AAS)
Mode = AAS, side a = 10, angle A = 30 deg, angle B = 60 deg.
C = 90 deg. k = 10 / sin(30 deg) = 20. b = 20 * sin(60 deg) ~= 17.3205, c = 20 * sin(90 deg) = 20.
Missing side c = 20.0000 units, side b = 17.3205 units, angle C = 90.00 deg, perimeter = 47.3205 units.
The 30-60-90 case lets the calculator recover both unknown sides in one pass, which is the strength of the Law of Sines path.
According to Wolfram MathWorld, Law of Cosines, Law of Cosines c^2 = a^2 + b^2 - 2ab*cos(C) is valid for any planar triangle with sides a, b, c and included angle C
According to Wikipedia, Law of cosines, c^2 = a^2 + b^2 - 2ab*cos(C), which rearranges to c = sqrt(a^2 + b^2 - 2ab*cos(C))
If you have three sides and want the angles, SSS triangle calculator covers the inverse problem and labels the triangle as acute, right, or obtuse.
Key Concepts Explained
Four ideas cover the two paths the triangle side calculator uses to recover a missing side. Each is a small, well-known result from Euclidean geometry.
Law of Cosines
A general identity that relates two sides and the included angle to the third side. c^2 = a^2 + b^2 - 2ab*cos(C) holds for any triangle.
Law of Sines
A ratio identity: a / sin(A) = b / sin(B) = c / sin(C) is the same constant for every triangle. Once you know one side-angle pair, the constant k is fixed.
Angle sum in a triangle
The three interior angles of a Euclidean triangle sum to 180 degrees. Knowing two angles gives the third, which the AAS path uses with the Law of Sines.
Choosing the right case
Use the Law of Cosines (SAS) for two sides and the included angle. Use the Law of Sines (AAS or ASA) for one side and two angles.
The selector at the top of the form chooses between the Law of Cosines path and the Law of Sines path, and the rest of the form provides the values each path needs.
When you only need to focus on the AAS case without the SAS path, AAS triangle calculator walks the Law of Sines in a single-mode form.
How to Use This Calculator
Use the same form for both cases. The mode selector at the top tells the calculator which identity to apply, and the input rows change to match the chosen case.
- 1 Pick the case that matches your data: Choose SAS if you know two sides and the angle between them. Choose AAS if you know one side and two angles.
- 2 Enter side a: Type a positive side length in any unit. The result will be reported in the same unit.
- 3 Enter the second piece of data: For SAS, type side b and the included angle C. For AAS, type angle A and angle B in degrees.
- 4 Read the missing side: The result panel shows the recovered side c at the top. The label always says 'Missing side (c)' regardless of the case you picked.
- 5 Read the other angles and sides: The result panel also lists the other two sides and all three angles, so you can see the full triangle.
- 6 Use the perimeter for layout and cuts: Copy the perimeter for fence, trim, or framing totals. It is the sum of the three sides in the unit you entered.
A contractor measures two sides of a triangular garden bed as 8 m and 11 m and lays out the included corner at 50 degrees with a string line. Switching the form to SAS and entering a = 8, b = 11, C = 50 returns the missing side c = 8.5874 m, plus the two unknown angles and a perimeter of 27.5874 m for ordering edging.
If you need to switch between SSS, SAS, ASA, AAS, and AAA without re-entering values, triangle calculator handles all five cases behind one form.
Benefits of Using This Calculator
The triangle side calculator combines the two main identities behind one form, so a single page covers the bulk of the textbook cases without bouncing the user between tools.
- • Handles both main cases: SAS via the Law of Cosines and AAS via the Law of Sines live in the same form, so a user does not have to know which sub-tool to open first.
- • Reports more than the missing side: The result panel also returns the other sides, all three angles, and the perimeter, so the user gets a complete description of the triangle in one submission.
- • Validates inputs up front: Angles must be strictly between 0 and 180, side lengths must be positive, and the two AAS angles must sum to less than 180. The form rejects bad input.
- • Works in any length unit: Type sides in metres, feet, inches, or centimetres. The result is in the same unit, with no extra conversion step on the way to a cut list.
These benefits matter most when the inputs come from a real measurement rather than a textbook. A tape, a clinometer, and the form cover most of the triangles a contractor, surveyor, or student will meet in practice.
For a single-mode form that focuses on the Law of Cosines path only, SAS triangle calculator covers the SAS case in isolation.
Factors That Affect Your Results
The triangle side calculator has a small set of factors and limits. The values are stable across the math-conversion family, but the assumptions below are worth knowing before you trust the output for a cut list or a design calculation.
Mode selector drives the formula
Switching between SAS and AAS changes the formula. The result panel always labels the recovered side as c, but the meaning of c is set by the case you pick.
Angle units are degrees
The form takes degrees, not radians. If you have radians, convert them first, or the trigonometric values will be wrong by a factor of about 57.
Triangle inequality is implicit in SAS
For SAS, the recovered side c is positive whenever the included angle is strictly between 0 and 180. The form rejects angles of 0 or 180, which would force a degenerate line.
- • The triangle side calculator covers SAS and AAS only. For three sides and an angle, the SSS case applies; use the dedicated SSS triangle calculator.
- • The formulas assume a planar Euclidean triangle. They do not apply to spherical triangles on a globe, where the Law of Cosines for sides takes a different form.
These limits are not weaknesses of the formulas, they are limits of the input cases. The two identities are exact for any planar Euclidean triangle; the calculator routes the input to the identity that fits.
According to Wikipedia, Law of sines, a / sin(A) = b / sin(B) = c / sin(C) holds for any triangle, and the common ratio lets you recover any unknown side
If the two known angles are on the ends of the known side, the ASA case applies and ASA triangle calculator solves it directly.
Frequently Asked Questions
Q: How do you find a missing side of a triangle?
A: Pick the case that matches the data you have. With two sides and the included angle, apply the Law of Cosines: c = sqrt(a^2 + b^2 - 2ab*cos(C)). With one side and two angles, complete the third angle and apply the Law of Sines: side_known * sin(opposite of missing) divided by sin(opposite of known).
Q: What is the law of cosines formula for a triangle side?
A: For sides a, b, c and the included angle C between a and b, the Law of Cosines is c^2 = a^2 + b^2 - 2ab*cos(C), so the missing side is c = sqrt(a^2 + b^2 - 2ab*cos(C)). The identity holds for any triangle, including right and obtuse triangles.
Q: What is the law of sines formula for a triangle side?
A: The Law of Sines says a / sin(A) = b / sin(B) = c / sin(C). The common ratio k = a / sin(A) lets you recover the other sides as k * sin(opposite angle) once one side-angle pair is known.
Q: Can you find a side of a triangle with two sides and an angle?
A: Yes, as long as the angle is the included angle between the two known sides. The Law of Cosines then gives the third side directly. If the angle is not the included angle, you have the SSA case, which can have zero, one, or two valid solutions.
Q: Can you find a side of a triangle with two angles and a side?
A: Yes. Subtract the two known angles from 180 to recover the third angle, then use the Law of Sines. The recovered side equals the known side times the sine of the opposite angle of the missing side, divided by the sine of the known side's opposite angle.
Q: When should I use the law of sines vs the law of cosines?
A: Use the Law of Sines when you know one side-angle pair and one other angle, which is the AAS or ASA case. Use the Law of Cosines when you know two sides and the included angle, which is the SAS case. The Law of Cosines is the more general identity and also covers the SSS case, but you need a different starting formula there.