A cosine calculator can help you solve many trigonometric problems. You will learn what the law of cosines (also known as the law of cosines) is.Cosine type theoremand its applications. Scroll down to learn when and how to use the law of cosines and see proofs of this law. Quickly find the properties of any triangle with this triangle calculator.

But if you're kind of wondering what the hell cosine is, you'd better check out ourscosine calculator.
Law of cosine formula
The law of cosines states that for a triangle with sides and angles marked with symbols as shown above,
a² = b² + c² - 2bc × cos(α)
b² = a² + c² - 2ac × cos(β)
c² = a² + b² - 2ab × cos(γ)
For a right triangle, the gamma angle is the angle between the legsONE
andand
, is equal to 90°. Cosine of 90° = 0, so in this particular case the formula for the law of cosines reduces to the well-known equationPythagoras' lesson:
a² = b² + c² - 2bc × cos(90°)
a² = b² + c²
What is the law of cosines?
The law of cosines (alternatively the formula of cosines or the law of cosines) describes the relationship between the lengths of the sides of a triangle and the cosines of its angles. It can be applied to all triangles, not just right triangles. This law generalizes the Pythagorean theorem because it allows you to calculate the length of one side when you know the length of both other sides and the angle between them.
The law appeared in EuclidElement, a mathematical treatise containing definitions, axioms, and theorems for geometry. Euclid did not formulate it in the way we know it today because the concept of cosine had not yet been developed.

AB² = CA² + CB² - 2 × CA × CH
(for sharp corners, '+' for blunt)
However, we can easily reformulate Euclid's theorem into the current cosine form:
CH = CB × cos(γ)
, SoAB² = CA² + CB² - 2 × CA × (CB × cos(γ))
Changing the notation, we get the well-known expression:
c² = a² + b² - 2ab × cos(γ)
The first explicit equation of the cosine rule was presented by the Persian mathematician d'Al-Kashi in the 15th century. In the 16th century, the law was popularized by the famous French mathematician Viète before taking its final form in the 19th century.
Applications of the law of cosines
You can convert these formulas to the law of cosines to solve some triangulation problems (solving triangles). You can use them to find:
The third side of the triangle, knowing the two sides and the angle between them (SAS):
a = √[b² + c² - 2bc × cos(α)]
b = √[a² + c² - 2ac × cos(β)]
c = √[a² + b² - 2ab × cos(γ)]
Triangular corners, knowing all three sides (SSS):
α = uki [(b2 + c2 - a2)/(2bc)]
β = uki [(a2 + c2 - b2)/(2ac)]
γ = luk [(a² + b² - c²)/(2ab)]
The third side of the triangle, knowing the two sides and the angle opposite one of them (SSA):
a = b × cos(γ) ± √[c² - b² × sin²(γ)]
b = c × cos(α) ± √[a² - c² × sin²(α)]
c = a × cos(β) ± √[b² - a² × sin²(β)]
Just remember that knowing two sides and an adjacent angle can give you two different possible triangles (either one or zero positive solutions, depending on the data). That's why we decided to implement SAS and SSS in this tool, but not SSA.
The law of cosines is one of the fundamental laws and is widely used in many geometrical problems. We also use this right in many Omnitools, to name just a few:
- Triangle angle calculator
- Triangle area calculator
- Triangle perimeter calculator
- Triangular prism calculator
You can also combine the law of cosines with a calculatorlaw of sinesolving other problems such as finding the side of a triangle with two angles and one side (AAS and ASA).
Law of proof of cosines
There are many ways to prove the cosine theorem. You have already read about one of them - it directly follows from Euclid's formulation of laws and the application of the Pythagorean theorem. You can write other proofs of the cosine theorem using:
1. Trigonometry

At the height of the triangle, draw a line and divide the page perpendicular to it into two parts:
b = b1 + b2
From the definition of sine and cosine,b1can be expressed asa × cos(c)andb₂ = c × cos(α). Therefore:
b = a × cos(γ) + c × cos(α)and multiplication byand, we get:
b² = ab × cos(c) + bc × cos(α)(1)
Analogous equations can be derived for the other two sides:
a² = ac × cos(β) + ab × cos(γ)(2)
c2 = bc × cos(α) + ac × cos(β)(3)
To complete the proof of the law of cosines, add equations (1) and (2) and subtract (3):
a² + b² - c² = ac × cos(β) + ab × cos(γ) + bc × cos(α) + ab × cos(γ) - bc × cos(α) - ac × cos(β)
Reducing and simplifying the equation gives one form of the cosine rule:
a² + b² - c² = 2ab × cos(γ)
c² = a² + b² - 2ab × cos(γ)
By changing the order in which they are added and subtracted, you can derive the second law of cosine formulas.
2. Type of distance

allowC = (0,0),A = (b,0), like on the picture.
To find the coordinates of B, we can use the definition of sine and cosine:
B = (a × cos(γ), a × grzech(γ))
fromtype of distance, we can conclude that:
c = √[(x₂ - x₁)² + (y₂ - y₁)²] = √[(a × cos(γ) - b)² + (a × sin(γ) - 0)²]
Therefore:
c² = a² × cos(γ)² - 2ab × cos(γ) + b² + a² × sin(γ)²
c² = b² + a²(sin(γ)² + cos(γ)²) - 2ab × cos(γ)
Since the sum of square sines and cosines is equal to 1, we get the final formula:
c² = a² + b² - 2ab × cos(γ)
3. Ptolemy's theorem

Another proof of the law of cosines that is relatively easy to understand uses Ptolemy's theorem:
Suppose we have drawn a triangle ABC in its circle, as in the picture.
Construct an equilateral triangle ADC where AD = BC and DC = BA
The altitudes from points B and D divide the base AC from E and F respectively. CE is equal to FA.
From the definition of cosine we can express CE asa × cos(c).
So we can write itBD = EF = AC - 2 × CE = b - 2 × a × cos(γ).
Then for our quadrilateral ADBC we can usePtolemy's theorem, which explains the relationship between four sides and two diagonals. The theorem says that for circular quadrilaterals, the sum of the products of the opposite sides is equal to the product of the two diagonals:
BC × DA + CA × BD = AB × CD
so in our case:
a² + b × (b - 2 × a × cos(γ)) + a² = c²
After the reduction, we get the final formula:
c² = a² + b² - 2ab × cos(γ))
The great advantage of these three proofs is their universality - they work for acute, right and obtuse triangles.
- Using the Law of Sines
- UseDefinition of internal product
- Comparison of surfaces
- Circle geometry
The last two proofs require distinguishing different cases of triangles. The one based on the definition of the inner product is presented in another article, and the proof using the law of sines is quite complicated, so we decided not to repeat it here. If you are interested in these cosine proofs, take a lookWikipediaexplanation.
How to use the cosine theorem calculator
Start by formulating the problem.For example, you can know two sides of a triangle and the angle between them and search for the other side.
Enter the known values in the corresponding fields of this triangle calculator.Make sure you've double-checked in the image above that you've labeled the sides and corners with the appropriate symbols.
Watch our cosine calculator do all the math for you!
(Video) Be careful typing Law of Cosines in your calculator
Law of cosines - SSS example
If your task is to find the angles of a triangle with respect to all three sides, you just need to use the formulas of the transformed cosine rule:
α = uki [(b2 + c2 - a2)/(2bc)]
β = uki [(a2 + c2 - b2)/(2ac)]
γ = luk [(a² + b² - c²)/(2ab)]
Let's calculate one of the angles. Suppose we have a = 4 inches, b = 5 inches, and c = 6 inches. We will use the first equation to find:
α = uki [(b2 + c2 - a2)/(2bc)]
= luk [(5² + 6² - 4²)/(2 × 5 × 6)]
= luk [(25 + 36 - 16)/60]
= arc [(45/60)] = arc [0.75]
α = 41.41°
You can calculate the second angle in the same way from the second equation, and you can find the third angle if you know that the sum of the angles in a triangle is 180° (π/2).
If you want to save time, enter page lengths into our theorem calculator - our tool is a safe bet! Just follow these simple steps:
Select the option according to the values listed. We have to choose another option -SSS (3 pages).
Enter known values. Enter the sides: a = 4 inches, b = 5 inches, and c = 6 inches.
The calculator displays the result!In our case, the angles are α = 41.41°, β = 55.77° and γ = 82.82°.
After this explanation, we are sure you understand what the law of cosines is and when to use it. Try this tool, do some practice and remember practice makes perfect!
Frequently asked questions
When should you use the law of cosines?
Use the law of cosines if you want to calculate:
- A side of a triangle with two other sides and an angle between them.
- Three angles of a triangle with respect to its sides.
- A side of a triangle that has two other sides and an angle opposite one of those sides.
When should I use the law of cosines and the Pythagorean theorem?
The law of cosines is a generalization of Pythagoras' lesson, so whenever the second one works, the first one can also be applied. However, not the other way around!
Does the law of cosines only apply to right triangles?
NOthe law of cosines applies to all triangles. In fact, when you apply the law of cosines to a right triangle, you end up with the good old Pythagorean theorem.
What is the third side of a triangle with sides 5 and 6?
In addition to the two sides, you also need to know one of the interior angles of the triangle. Let's say it's an angleγ = 30°between the parties5and6. After:
- Remember the law of cosinesc² = a² + b² - 2ab × cos(γ)
- Value connectionfor = 5,b = 6,γ = 30°.
- we acquirec² = 25 + 36 - 2 × 5 × 6 × cos(30) ≈ 9.
- This is the reason,do ≈ 3. Be sure to list the units if you received them!
FAQs
How do you memorize the cosine rule? ›
- think "abc": a2 + b2 = c2,
- then a 2nd "abc": 2ab cos(C),
- and put them together: a2 + b2 − 2ab cos(C) = c.
You only need to remember the +2abcos(C) bit. Yep. It's rearranged to resemble Pythagoras's formula. In the exams I just use that as a base and rearrange for what I need.
Can the law of cosine be used to solve any triangle for which two angles and a side are known? ›The Cosine Rule can be used in any triangle where you are trying to relate all three sides to one angle. If you need to find the length of a side, you need to know the other two sides and the opposite angle.
What is cosine rule easy? ›In trigonometry, the Cosine Rule says that the square of the length of any side of a given triangle is equal to the sum of the squares of the length of the other sides minus twice the product of the other two sides multiplied by the cosine of angle included between them.
What is the cosine rule grade 11? ›The cosine rule relates the length of a side of a triangle to the angle opposite it and the lengths of the other two sides. In △DCB: a2=(c−d)2+h2 from the theorem of Pythagoras.
What grade is cosine rule? ›This video is all about using the cosine rule, and is aimed at around grade 6 GCSE Maths. It's quite likely to be a non calculator question. You need to find x after being given three sides of a triangle (x+2), (root73) and (2x-3); as well as one angle of 60 degrees.
When can you not use cosine law? ›The four parts are three sides and one angle. So you either need 2 sides and an angle to solve for the remaining side or all three sides to solve for an angle. So if you know two angles (which lets you figure out the third so technically three angles) and a side you can't just use the law of cosines.
Can you solve right triangle by cosine law? ›The cosine of a right angle is 0, so the law of cosines, c2 = a2 + b2 – 2ab cos C, simplifies to becomes the Pythagorean identity, c2 = a2 + b2, for right triangles which we know is valid.
Does cosine rule only work for right triangles? ›Yes, the Law of Cosines works for all triangles.
Can law of cosines have 2 triangles? ›Solution: Since angle A is the only known angle, choose the Law of Cosines formula that utilizes angle A. Now, use the quadratic formula to solve for c. There are two possible triangles.
Why is my calculator giving wrong answers? ›
Check the batteries. Check that you are pressing the correct keys. Check it is in the correct input mode. Replace it.
How do calculators find sine and cosine? ›Calculators don't actually use the Taylor series but the CORDIC algorithm to find values of trigonometric functions. The Cordic algorithm is based on thinking of the angle as the phase of a complex number in the complex plane, and then rotating the complex number by multiplying it by a succession of constant values.
How do you find cos 80 without a calculator? ›The value of cos 80 degrees can be calculated by constructing an angle of 80° with the x-axis, and then finding the coordinates of the corresponding point (0.1736, 0.9848) on the unit circle. The value of cos 80° is equal to the x-coordinate (0.1736). ∴ cos 80° = 0.1736.
Do I need a special calculator for trigonometry? ›The TI-84 Plus is the ideal choice for trigonometry as it is a graphing calculator and has all the necessary features to solve complex trigonometry questions. The calculator is also approved to use in IB exams. Here are the top features of this calculator: Ideal to use for AP, SAT, and PSAT tests.
What is the best calculator to use for trigonometry? ›- Trigonometry Calculator, at Symbolab. Symbolab offers this helpful trigonometry calculator to help you 'calculate trigonometric equations, prove identities, and evaluate functions step by step'. ...
- Trigonometry Calculator, at Mathway. ...
- Trig calculator, by Microsoft. ...
- Right Triangle Calculator.
In order to do trigonometry calculations, you should have a calculator with buttons for tan, cos, and sin. Before you begin, make sure that your calculator is in degree mode, not radian mode.
Is there a formula for cosine? ›Let us consider a right-angled triangle with one of its acute angles to be x. Then the cosine formula is, cos x = (adjacent side) / (hypotenuse), where "adjacent side" is the side adjacent to the angle x, and "hypotenuse" is the longest side (the side opposite to the right angle) of the triangle.
What type of math is law of cosines? ›The law of cosines is useful for solving a triangle when all three sides or two sides and their included angle are given.
What are the two formulas for cosine rule? ›Law of cosines can be used to find the missing side or angle of a triangle by applying any of the following formulas, a2 = b2 + c2 - 2bc·cosA. b2 = c2 + a2 - 2ca·cosB.
What is cosine in algebra? ›cosine. noun. co·sine ˈkō-ˌsīn. : a trigonometric function that is the ratio between the side next to an acute angle in a right triangle and the hypotenuse.
Can cosine equal 0? ›
The value of cos 0 is 1. Here, we will discuss the value for cos 0 degrees and how the values are derived using the quadrants of a unit circle. The trigonometric functions are also known as an angle function that relates the angles of a triangle to the length of the triangle sides.
What is a 30 60 90 Triangle? ›What Is a “30-60-90” Triangle? A special right triangle with angles 30°, 60°, and 90° is called a 30-60-90 triangle. The angles of a 30-60-90 triangle are in the ratio 1 : 2 : 3. Since 30° is the smallest angle in the triangle, the side opposite to the 30° angle is always the smallest (shortest leg).
Is cosine a calculus? ›In calculus, the derivative of cos(x) is –sin(x). This means that at any value of x, the rate of change or slope of cos(x) is –sin(x). For more on this see Derivatives of trigonometric functions together with the derivatives of other trig functions. See also the Calculus Table of Contents.
What is cos 120 grades? ›Answer: The value of cos 120 degrees is -1/2.
Can you use 90 degrees in cosine law? ›The Law of Cosines states: c2=a2+b2−2ab cosC . This resembles the Pythagorean Theorem except for the third term and if C is a right angle the third term equals 0 because the cosine of 90° is 0 and we get the Pythagorean Theorem.
Does cosine have a limit? ›The limit does not exist. Most instructors will accept the acronym DNE. The simple reason is that cosine is an oscillating function so it does not converge to a single value.
What angle is depression? ›What is Angle of Depression? The angle of depression is defined as an angle constructed by a horizontal line and the line joining the object and observer's eye. This angle is dependent on two factors, i.e., height and distance. Let us learn about its definition, formula and real-life problems based on it.
Can you use Pythagorean theorem on law of cosines? ›If the included angle is a right angle then the Law of Cosines is the same as the Pythagorean Theorem.
Which of the following Cannot be solved using the law of sine? ›If we are given two sides and an included angle of a triangle or if we are given 3 sides of a triangle, we cannot use the Law of Sines because we cannot set up any proportions where enough information is known.
Does cosine rule apply to all angles? ›To solve a triangle is to find the lengths of each of its sides and all its angles. The sine rule is used when we are given either a) two angles and one side, or b) two sides and a non-included angle. The cosine rule is used when we are given either a) three sides or b) two sides and the included angle.
Does Soh CAH TOA only work on right triangles? ›
Q: Is sohcahtoa only for right triangles? A: Yes, it only applies to right triangles. If we have an oblique triangle, then we can't assume these trig ratios will work. We have other methods we'll learn about in Math Analysis and Trigonometry such as the laws of sines and cosines to handle those cases.
What if 2 triangles have equal angles? ›Congruent triangles have the same corresponding angle measures and side lengths.
What does cos mean in a calculator? ›The cosine function is one of the three major functions of trigonometry. These three functions are also termed as trigonometric ratios, which are sine, cosine and tangent. The cos meaning in trigonometry defines the cosine of an angle.
What's the cosine of 45? ›Cos 45° Value
The approximate value of cos 45 is equal to 0.7071. Therefore, 0.7071 or 1/√2 is a value of a trigonometric function or trigonometric ratio of standard angle (45 degrees).
The value of cos 25 degrees can be calculated by constructing an angle of 25° with the x-axis, and then finding the coordinates of the corresponding point (0.9063, 0.4226) on the unit circle. The value of cos 25° is equal to the x-coordinate (0.9063). ∴ cos 25° = 0.9063.
What is sin 30 without calculator? ›The value of sin 30 degrees is 0.5. Sin 30 is also written as sin π/6, in radians. The trigonometric function also called as an angle function relates the angles of a triangle to the length of its sides.
What value of cos is 1? ›The value of cos 1° is equal to the x-coordinate (0.9998). ∴ cos 1° = 0.9998.