Solve any triangle using the Law of Cosines. Choose between SAS (two sides and the included angle) to find the third side and remaining angles, or SSS (all three sides) to find all angles. Results include area, perimeter, and triangle type.
In SAS mode, sides a and b are the two known sides and C is the angle between them. Side c is the unknown. In SSS mode, all sides are known and the formula is rearranged to find each angle using arccos.
The Law of Cosines is a fundamental trigonometric rule that relates the three sides of any triangle to one of its angles. It is most commonly written as:
where a, b, and c are side lengths and C is the angle opposite side c. The formula works for any triangle, not just right-angled ones. It is a direct generalisation of Pythagoras's theorem: when C equals 90 degrees, cos(C) = 0 and the formula reduces to c² = a² + b².
You can apply the same formula cyclically to find each angle or side:
To find an angle from three known sides, rearrange to isolate the cosine term:
Then apply the inverse cosine function (arccos) to get the angle in degrees.
| Known information | Configuration | Method |
|---|---|---|
| Two sides and the included angle | SAS | Law of Cosines: find the third side, then use Law of Sines or Cosines for remaining angles |
| All three sides | SSS | Law of Cosines rearranged: find each angle using arccos |
| Two angles and one side | AAS or ASA | Law of Sines is simpler |
| Two sides and a non-included angle | SSA | Law of Sines (note: may have two solutions) |
In SAS mode, you enter sides a and b and the angle C between them. The calculator uses c² = a² + b² − 2ab·cos(C) to find side c, then finds angle A using cos(A) = (b² + c² − a²) / (2bc). Angle B follows from B = 180 − A − C.
In SSS mode, you enter all three sides. The calculator finds angle C = arccos((a² + b² − c²) / (2ab)), then angle A = arccos((b² + c² − a²) / (2bc)), and B = 180 − A − C. The three angles are always verified to sum to 180 degrees.
Area is calculated using the formula Area = (1/2)·a·b·sin(C), which requires only two sides and the included angle.
Once all three angles are known, the triangle is classified by its angles and by its sides:
Suppose a = 5, b = 7, and C = 60°. Using the Law of Cosines:
Sources and method: Law of Cosines: standard trigonometric identity derived from the dot product of vectors. Area formula: (1/2)ab sin(C). Triangle classification follows standard geometric definitions. All calculations use exact floating-point arithmetic via JavaScript Math.cos, Math.acos, and Math.sqrt.
Results are computed to four decimal places. For very large or very small side lengths, floating-point rounding may affect the last digit. Always verify critical engineering calculations independently.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.