Given two sides A, B and angle C. Find the third side of the triangle using law of cosines.
Input : a = 5, b = 8, c = 49 Output : 6.04339
In particular, the Law of Cosines can be used to find the length of the third side of a triangle when you know the length of two sides and the angle in between. See here to learn to how to find the value of cos.
Let us assume a, b, c are the sides of triangle where c is the side across from angle C. Then,
c^2 = a^2 + b^2 - 2*a*b*cos(c) OR c = sqrt(a^2 + b^2 - 2*a*b*cos(c))
- Find coordinates of the triangle given midpoint of each side
- Program to find the side of the Octagon inscribed within the square
- Program to find Circumcenter of a Triangle
- Program to find area of a triangle
- Program to find the Centroid of the triangle
- Program to Find the Incenter of a Triangle
- Program to find the Type of Triangle from the given Coordinates
- Program to find the Radius of the incircle of the triangle
- Program to find Area of Triangle inscribed in N-sided Regular Polygon
- Program to calculate area of a rhombus whose one side and diagonal are given
- Find the Side of the smallest Square that can contain given 4 Big Squares
- Check if it is possible to draw a straight line with the given direction cosines
- Find the side of the squares which are inclined diagonally and lined in a row
- Find the side of the squares which are lined in a row, and distance between the centers of first and last square is given
- Program to print Sum Triangle for a given array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.