Cosine Triangle Calculator

This calculator solves any triangle using the Law of Cosines, letting you find a missing side or all three angles depending on what information you already have. Choose SAS mode when you know two sides and the angle between them, entering side a, side b, and the included angle C in degrees; the calculator applies c² = a² + b² − 2ab·cos(C) to find the missing side c, then works out angles A and B. Choose SSS mode when you know all three side lengths and want every angle; enter sides a, b and c and the calculator rearranges the Law of Cosines with arccos to solve for angles A, B and C, checking they sum to exactly 180 degrees. Either way you get back the missing side or angle, the two remaining angles, the triangle's area, its perimeter, and a classification by both angle type (acute, right or obtuse) and side type (equilateral, isosceles or scalene). A worked example below the results shows the arithmetic step by step so you can follow how each figure was reached. This is useful for geometry homework, surveying, construction layout, navigation and any situation where you need to work out a triangle's dimensions from partial measurements. If your three side lengths cannot form a valid triangle, the calculator will flag it rather than return a misleading answer.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Standard formula  Law of Cosines: c² = a² + b² − 2ab·cos(C). Exact trigonometric identities.

1. Solve Mode

Please check your inputs. Ensure all values are positive numbers and the sides can form a valid triangle.

2. Active Formula

c² = a² + b² − 2ab·cos(C)

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.

Results

Side c
-
Opposite angle C
Angle A
-
Opposite side a
Angle B
-
Opposite side b
Angle C
-
Opposite side c

Triangle Sides

Side a-
Side b-
Side c-
Perimeter-

Triangle Properties

Angle A-
Angle B-
Angle C-
Area-
Triangle type-
Worked example: With sides a = 5, b = 7 and included angle C = 60°, the Law of Cosines gives c² = 25 + 49 − 2(5)(7)cos(60°) = 74 − 35 = 39, so c = 6.245 units.

The Law of Cosines Explained

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:

c² = a² + b² − 2ab·cos(C)

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:

cos(C) = (a² + b² − c²) / (2ab)

Then apply the inverse cosine function (arccos) to get the angle in degrees.

When to Use the Law of Cosines

Known informationConfigurationMethod
Two sides and the included angleSASLaw of Cosines: find the third side, then use Law of Sines or Cosines for remaining angles
All three sidesSSSLaw of Cosines rearranged: find each angle using arccos
Two angles and one sideAAS or ASALaw of Sines is simpler
Two sides and a non-included angleSSALaw of Sines (note: may have two solutions)

How the Calculator Works

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.

Triangle Classification

Once all three angles are known, the triangle is classified by its angles and by its sides:

Worked Example

Suppose a = 5, b = 7, and C = 60°. Using the Law of Cosines:

Related Calculators

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-19 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.