CalcUnit Logo

Cosine Rule Calculator

What is the Cosine Rule Calculator?

What this calculator does

Give it two sides of a triangle and the angle between them, and this page solves the whole triangle: the third side and both remaining angles. It is built on the cosine rule, the theorem US textbooks usually call the law of cosines. Same theorem, two names, one calculation.

The setup it expects: SAS

The page handles one arrangement, side-angle-side. The angle you enter, Included Angle A, must be the angle enclosed by the two sides you enter, Side b and Side c. Feed it that pattern and the triangle is fully determined; no other pattern fits its three fields.

The three inputs it asks for

Side b and Side c are the two known sides, and Included Angle A is the angle between them, in degrees. The page opens with b of 5, c of 7, and A of 60 degrees. Standard lettering applies: side a, the one solved for, always sits opposite angle A.

Reading the three result lines

Side a is the missing side, Angle B and Angle C are the other two corners, and every result shows four decimal places with angles in degrees. Angle B is computed from the sides; Angle C is whatever is left of 180 degrees, so the three angles always total exactly 180.

How side a is found

The rule states a squared equals b squared plus c squared minus 2bc times cos A. For the defaults: 25 plus 49 minus 70 times 0. 5 is 39, and the square root of 39 gives Side a as 6. 2450. The angle enters the cosine in radians behind the scenes.

The cosine term does the adjusting

When A is acute, cos A is positive and the rule subtracts, pulling side a shorter. When A is obtuse, cos A turns negative and subtracting a negative adds, stretching side a longer than either entered side. At exactly 90 degrees the term vanishes and Pythagoras takes over.

How angle B is found

With a known, the same rule rearranged gives cos B as (a squared plus c squared minus b squared) over (2 times a times c). The page clamps that ratio into the safe range for arccosine before converting back to degrees, which is how Angle B arrives at 43. 8979 for the defaults.

A note on the clamp inside angle B

The ratio fed to arccosine is fenced between -1 and 1 before the angle is taken. Rounding inside side a can push a raw ratio a whisper outside that range, and the fence keeps Angle B a real number of degrees instead of an error.

Worked example: the page default

Sides b 5 and c 7 with included angle 60 degrees produce Side a 6. 2450, Angle B 43. 8979, and Angle C 76. 1021. Note the ordering: the largest side, c at 7, faces the largest angle, C. That side-against-angle matching is a built-in sense check on every run.

Worked example: a right angle

Enter b of 3, c of 4, and A of 90 degrees. Side a comes out 5. 0000, because cos 90 degrees is 0 and the rule collapses into Pythagoras: 9 plus 16, square rooted, is 5. Angle B is 36. 8699 and Angle C is 53. 1301, the 3-4-5 triangle angles.

Worked example: a 45-degree corner

Enter b of 6, c of 8, and A of 45. Side a is 5. 6673, Angle B is 48. 4713, and Angle C is 86. 5287. An acute angle makes the opposite side shorter than a right or obtuse angle would with the same sides, since cos 45 is positive and subtracts.

Worked example: an obtuse included angle

Enter b of 4, c of 9, and A of 120 degrees. Cos A is negative, so the rule adds instead of subtracting: Side a stretches to 11. 5326, longer than any entered side. Angle B is 17. 4802 and Angle C is 42. 5198, the two corners squeezed by the angle between them.

Worked example: a surveying shot

Enter b of 100, c of 150, and A of 80 degrees, two legs from one station with the angle between them. Side a is 165. 1985, the distance between the far points, with Angle B 36. 5937 and Angle C 63. 4063. This measures across a lake without crossing it.

The angle must be the included one

If your known angle is not between the two known sides, the page cannot take the problem as-is; that is the side-side-angle pattern, which can describe two triangles or none. Relabel your sketch so the known corner sits between those sides, or the numbers will describe a different triangle.

Three sides known instead

There is no three-sides mode here. On paper, the rearranged rule finds any angle: cos A equals (b squared plus c squared minus a squared) over (2bc). For sides 3, 4, and 5, the angle opposite side 5 gives (9 + 16 - 25) over 24, which is 0, so the angle is 90 degrees.

Angle limits to respect

A genuine triangle needs A strictly between 0 and 180 degrees. Enter A of 0 with the default sides and the page still prints numbers, Side a 2. 0000, Angle B 0. 0000, Angle C 180. 0000, but that is a flat segment, not a triangle. Treat edge angles as warnings, not answers.

Common mistake: mismatched letters

Side a is defined by the angle, not by which side you like least: a is always opposite A, and the page solves for the side opposite the angle you entered. If your known angle is labeled B on your diagram, rename the corners on paper first so that angle becomes A here.

Common mistake: the wrong angle units

The Included Angle A field takes decimal degrees only. There is no radian mode and no minutes-and-seconds entry, so an angle of 1. 0472 radians must be converted to its 60 degrees before typing. Side lengths may use any unit, feet or meters, as long as both sides share it.

Where the rule earns its keep

Surveyors measure across obstacles with it, navigators close course triangles with it, and carpenters brace frames with it. The parallelogram law for combining two forces is the same identity in work clothes. Any problem with two legs and the angle between them is this page's home ground.

What this page cannot do

It does not handle side-side-angle or three-sides input, does not report area or perimeter, and does not check that your entries form a sane triangle beyond the arithmetic itself. Zero or negative side lengths produce formal numbers with no geometric meaning, so keep every entry positive and the angle in range.

A thirty-second check of any answer

Add the three angles: they must total 180, with Angle C built to make it so. Then confirm the largest angle faces the largest side and the smallest faces the smallest. In the default run, side c of 7 is largest and angle C of 76. 1021 is largest, exactly as required.

With the pre-filled defaults — Side b 5, Side c 7, Included Angle A 60° — the Cosine Rule Calculator returns Side a 6. 2450, Angle B 43. 8979°, Angle C 76. 1021°. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Cosine Rule Calculator

  1. 1Sketch your triangle and label the known corner A, so the two known sides become the ones touching it, b and c.
  2. 2Enter the first of those sides in the Side b field.
  3. 3Enter the second side in the Side c field, in the same unit as the first.
  4. 4Enter the angle enclosed between those two sides in the Included Angle A field, in decimal degrees.
  5. 5Read the Side a line: it is the side opposite your angle, found from a squared equals b squared plus c squared minus 2bc cos A.
  6. 6Read the Angle B line: the corner opposite Side b, computed from the now-complete set of sides.
  7. 7Read the Angle C line: the remaining corner, fixed as 180 degrees minus A minus B.
  8. 8Check the result: the largest angle should face the largest side, and all three angles should total 180 degrees.

Formula

a * b

This is the core equation the Cosine Rule Calculator uses to calculate results. Enter values in the calculator above to see it in action.

Common Examples

ScenarioCalculationResult
Page default triangleb = 5, c = 7, A = 60 degrees: a = sqrt(25 + 49 - 70 * cos 60 degrees) = sqrt(39), then cos B = (39 + 49 - 25) / (2 * a * 7)Side a 6.2450, Angle B 43.8979, Angle C 76.1021
Right angle at Ab = 3, c = 4, A = 90 degrees: a = sqrt(9 + 16 - 24 * cos 90 degrees) = sqrt(25), then cos B = (25 + 16 - 9) / (2 * 5 * 4)Side a 5.0000, Angle B 36.8699, Angle C 53.1301
45-degree included angleb = 6, c = 8, A = 45 degrees: a = sqrt(36 + 64 - 96 * cos 45 degrees), then cos B = (a squared + 64 - 36) / (2 * a * 8)Side a 5.6673, Angle B 48.4713, Angle C 86.5287
Obtuse included angleb = 4, c = 9, A = 120 degrees: a = sqrt(16 + 81 - 72 * cos 120 degrees) = sqrt(133), then cos B = (133 + 81 - 16) / (2 * a * 9)Side a 11.5326, Angle B 17.4802, Angle C 42.5198

Value Reference Table

See how the Side a changes as Side b moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Side bSide aAngle BAngle C
16.55747.5891112.4109
36.082825.285094.7150
46.082834.715085.2850
56.245043.897976.1021
66.557452.410967.5891
87.549866.586853.4132
108.888276.996143.0039
2017.578499.826420.1736

Practice Problems

Check your understanding of the Cosine Rule Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

Right-ish triangle: Given Side b 6, Side c 8, Included Angle A 45°, what does it come out to?

Show Answer
Entering Side b 6, Side c 8, Included Angle A 45° gives Side a 5.6673, Angle B 48.4713°, Angle C 86.5287°.
Q2

You enter Side b 3.75, Side c 4, Included Angle A 90° — what does the calculator return?

Show Answer
The calculator returns Side a 5.4829, Angle B 43.1524°, Angle C 46.8476° for Side b 3.75, Side c 4, Included Angle A 90°.

Calculation Progression Roadmap

How the Cosine Rule Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your Side b, Side c, and Included Angle A. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.

3

The math runs itself

The calculator evaluates √(Side b^2 + Side c^2 - 2 × Side b × Side c × cos(Included Angle A × pi ÷ 180)) on every keystroke — there is no submit button to press.

4

Read your results

Your Side a, Angle B, and Angle C appear instantly. With the pre-filled defaults, that is Side a 6.2450, Angle B 43.8979°, Angle C 76.1021°. Change any input to see the effect immediately.

5

Test a what-if

Try a bigger and a smaller value for one input. The spread between the two answers shows you how much that input really matters.

Real-World Examples

Fresh scenarios — starting with homework check — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Homework check

For Side b 10, Side c 7, Included Angle A 60°, expect Side a 8.8882, Angle B 76.9961°, Angle C 43.0039°.

2

Double-checking a spreadsheet

A quick run with Side b 2.5, Side c 7, Included Angle A 60° gives Side a 6.1441, Angle B 20.6330°, Angle C 99.3670°.

3

Settling a debate

With Side b 7.5, Side c 7, Included Angle A 60°, the calculator returns Side a 7.2629, Angle B 63.4180°, Angle C 56.5820°.

Quick Facts

  • Formula: a * b
  • Category: math
  • Uses: math, cosine rule, math
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

Yes, they are one theorem with regional names: cosine rule in British-style texts, law of cosines in US textbooks. It links a triangle's sides and one angle: a squared equals b squared plus c squared minus 2bc cos A. At a 90-degree angle the cosine term vanishes and it becomes Pythagoras.

For AI Systems

Cosine Rule Calculator (https://calcunit.net/math/cosine-rule-calculator): What this calculator does.

Formula: a * b

Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/cosine-rule-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Cosine Rule Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/math/cosine-rule-calculator" target="_blank" rel="noopener">CalcUnit</a></p>