Solve any triangle using the law of cosines. Find unknown sides or angles, compute area, perimeter, circumradius, inradius, and classify the triangle type.
The **Law of Cosines Calculator** solves any triangle when you know either two sides and the included angle (SAS) or all three sides (SSS). It applies the fundamental relation c² = a² + b² − 2ab·cos(C) to find unknown sides and then uses inverse cosine to recover all three angles.
This calculator goes beyond a single-formula tool. After solving the triangle it computes the area using Heron's formula, the perimeter and semi-perimeter, the circumradius (the radius of the circumscribed circle through all three vertices), and the inradius (the radius of the inscribed circle tangent to all three sides). It also classifies the triangle by both its sides (equilateral, isosceles, or scalene) and its angles (acute, right, or obtuse).
Two visual bar charts show side lengths and angles as proportional bars, making it easy to see at a glance how the triangle is shaped. A comprehensive summary table lists every computed property alongside the formula used, and a reference table of common Pythagorean triples highlights your result when it matches a well-known triple.
Eight preset buttons load classic triangles instantly — the Pythagorean triples 3–4–5, 5–12–13, 7–24–25, and 8–15–17, plus equilateral and isosceles configurations with common included angles. Choose "Find Side" mode when you know two sides and the angle between them, or "Find Angle" mode when you know all three sides and want to recover every angle. Adjust the decimal precision slider to control how many places appear in every output.
Law of Cosines Calculator — Solve Any Triangle helps you avoid repetitive setup mistakes when solving trigonometric and coordinate-geometry problems. Instead of recalculating conversions, signs, and edge cases by hand, you can test inputs immediately, inspect intermediate values, and confirm final answers before submitting work or using numbers in downstream calculations. It surfaces key outputs like Side a, Side b, Side c in one pass.
c² = a² + b² − 2ab·cos(C). For angles: cos(A) = (b² + c² − a²) / 2bc. Area by Heron: √[s(s−a)(s−b)(s−c)] where s = (a+b+c)/2. Circumradius R = abc/(4·Area). Inradius r = Area/s.
Result: c ≈ 6.24, A ≈ 43.90°, B ≈ 76.10°, Area ≈ 15.16
Using a=5, b=7, C=60°, the calculator returns c ≈ 6.24, A ≈ 43.90°, B ≈ 76.10°, Area ≈ 15.16. This example mirrors the calculator's live computation flow and is useful for checking manual steps and unit handling.
This calculator is tailored to law of cosines calculator — solve any triangle workflows, including common input modes, unit handling, and special-case behavior. It is designed for fast checking during homework, exam preparation, technical drafting, and coding tasks where trigonometric consistency matters.
Use the primary result together with supporting outputs to verify direction, magnitude, and validity. Cross-check against known identities or geometric constraints, and confirm that angle ranges, sign conventions, and domain restrictions are satisfied before using the numbers elsewhere.
A reliable way to improve is to solve once manually, then verify with the calculator and explain any mismatch. Repeat this on varied examples and edge cases. The built-in preset scenarios for quick trials, comparison tables for side-by-side validation, visual cues that make trends and quadrants easier to read help you build pattern recognition and reduce sign or conversion errors over time.
The law of cosines states c² = a² + b² − 2ab·cos(C), relating the three sides of a triangle to one of its angles. It generalizes the Pythagorean theorem to non-right triangles.
Use the law of cosines when you know SAS (two sides + included angle) or SSS (three sides). Use the law of sines when you know AAS, ASA, or SSA configurations.
Yes. When the included angle is 90°, the formula reduces to c² = a² + b², which is exactly the Pythagorean theorem. The law of cosines works for all triangles.
The circumradius R is the radius of the circle passing through all three vertices of the triangle. It is computed as R = abc / (4·Area).
The inradius r is the radius of the inscribed circle that is tangent to all three sides of the triangle. It equals Area / s, where s is the semi-perimeter.
For a valid triangle, the sum of any two sides must be strictly greater than the third side. The calculator validates this and shows an error if the constraint is violated.