# Triangle calculator

You have entered side a, b and angle β.

Triangle has two solutions: a=39.8; b=27.5; c=20.13876781907 and a=39.8; b=27.5; c=41.1076526391.

### #1 Obtuse scalene triangle.

Sides: a = 39.8   b = 27.5   c = 20.13876781907

Area: T = 255.9879684879
Perimeter: p = 87.43876781907
Semiperimeter: s = 43.71988390953

Angle ∠ A = α = 112.4111242703° = 112°24'40″ = 1.96219463014 rad
Angle ∠ B = β = 39.7° = 39°42' = 0.6932895713 rad
Angle ∠ C = γ = 27.88987572966° = 27°53'20″ = 0.48767506391 rad

Height: ha = 12.86333007477
Height: hb = 18.61767043549
Height: hc = 25.42329591371

Median: ma = 13.59769864844
Median: mb = 28.38552169528
Median: mc = 32.6921948233

Vertex coordinates: A[20.13876781907; 0] B[0; 0] C[30.62221022909; 25.42329591371]
Centroid: CG[16.92199268272; 8.47443197124]
Coordinates of the circumscribed circle: U[10.06988390953; 19.02657545026]
Coordinates of the inscribed circle: I[16.21988390953; 5.8555134541]

Exterior (or external, outer) angles of the triangle:
∠ A' = α' = 67.58987572966° = 67°35'20″ = 1.96219463014 rad
∠ B' = β' = 140.3° = 140°18' = 0.6932895713 rad
∠ C' = γ' = 152.1111242703° = 152°6'40″ = 0.48767506391 rad

# How did we calculate this triangle?

The calculation of the triangle progress in two phases. The first phase is such that we try to calculate all three sides of the triangle from the input parameters. The first phase is different for the different triangles query entered. The second phase is the calculation of other characteristics of the triangle, such as angles, area, perimeter, heights, the center of gravity, circle radii, etc. Some input data also results in two to three correct triangle solutions (e.g., if the specified triangle area and two sides - typically resulting in both acute and obtuse) triangle).

### 2. From angle β, side a and side b we calculate side c - by using the law of cosines and quadratic equation:

$b^2 = a^2 + c^2 - 2a c \cos β \ \\ \ \\ 27.5^2 = 39.8^2 + c^2 - 2 \cdot \ 39.8 \cdot \ c \cdot \ \cos 39^\circ 42' \ \\ \ \\ \ \\ c^2 -61.244c +827.79 =0 \ \\ \ \\ p=1; q=-61.244; r=827.79 \ \\ D = q^2 - 4pr = 61.244^2 - 4\cdot 1 \cdot 827.79 = 439.692594849 \ \\ D>0 \ \\ \ \\ c_{1,2} = \dfrac{ -q \pm \sqrt{ D } }{ 2p } = \dfrac{ 61.24 \pm \sqrt{ 439.69 } }{ 2 } \ \\ c_{1,2} = 30.62210229 \pm 10.4844241002 \ \\ c_{1} = 41.106526391 \ \\ c_{2} = 20.1376781907 \ \\ \ \\ \text{ Factored form of the equation: } \ \\ (c -41.106526391) (c -20.1376781907) = 0 \ \\ \ \\ \ \\ c > 0 \ \\ \ \\ c = 41.107$

Now we know the lengths of all three sides of the triangle, and the triangle is uniquely determined. Next, we calculate another its characteristics - same procedure as calculation of the triangle from the known three sides SSS.

### 4. Semiperimeter of the triangle

The semiperimeter of the triangle is half its perimeter. The semiperimeter frequently appears in formulas for triangles that it is given a separate name. By the triangle inequality, the longest side length of a triangle is less than the semiperimeter.

### 5. The triangle area using Heron's formula

Heron's formula gives the area of a triangle when the length of all three sides are known. There is no need to calculate angles or other distances in the triangle first. Heron's formula works equally well in all cases and types of triangles.

### 6. Calculate the heights of the triangle from its area.

There are many ways to find the height of the triangle. The easiest way is from the area and base length. The area of a triangle is half of the product of the length of the base and the height. Every side of the triangle can be a base; there are three bases and three heights (altitudes). Triangle height is the perpendicular line segment from a vertex to a line containing the base.

### 7. Calculation of the inner angles of the triangle using a Law of Cosines

The Law of Cosines is useful for finding the angles of a triangle when we know all three sides. The cosine rule, also known as the law of cosines, relates all three sides of a triangle with an angle of a triangle. The Law of Cosines is the extrapolation of the Pythagorean theorem for any triangle. Pythagorean theorem works only in a right triangle. Pythagorean theorem is a special case of the Law of Cosines and can be derived from it because the cosine of 90° is 0. It is best to find the angle opposite the longest side first. With the Law of Cosines, there is also no problem with obtuse angles as with the Law of Sines, because cosine function is negative for obtuse angles, zero for right, and positive for acute angles. We also use inverse cosine called arccosine to determine the angle from cosine value.

An incircle of a triangle is a circle which is tangent to each side. An incircle center is called incenter and has a radius named inradius. All triangles have an incenter, and it always lies inside the triangle. The incenter is the intersection of the three angle bisectors. The product of the inradius and semiperimeter (half the perimeter) of a triangle is its area.

The circumcircle of a triangle is a circle that passes through all of the triangle's vertices, and the circumradius of a triangle is the radius of the triangle's circumcircle. Circumcenter (center of circumcircle) is the point where the perpendicular bisectors of a triangle intersect.

### 10. Calculation of medians

A median of a triangle is a line segment joining a vertex to the midpoint of the opposite side. Every triangle has three medians, and they all intersect each other at the triangle's centroid. The centroid divides each median into parts in the ratio 2:1, with the centroid being twice as close to the midpoint of a side as it is to the opposite vertex. We use Apollonius's theorem to calculate the length of a median from the lengths of its side.

### #2 Acute scalene triangle.

Sides: a = 39.8   b = 27.5   c = 41.1076526391

Area: T = 522.5254770354
Perimeter: p = 108.4076526391
Semiperimeter: s = 54.20332631955

Angle ∠ A = α = 67.58987572966° = 67°35'20″ = 1.18796463522 rad
Angle ∠ B = β = 39.7° = 39°42' = 0.6932895713 rad
Angle ∠ C = γ = 72.71112427034° = 72°42'40″ = 1.26990505884 rad

Height: ha = 26.25875261485
Height: hb = 38.00218014803
Height: hc = 25.42329591371

Median: ma = 28.75774034984
Median: mb = 38.05503712987
Median: mc = 27.3444256655

Vertex coordinates: A[41.1076526391; 0] B[0; 0] C[30.62221022909; 25.42329591371]
Centroid: CG[23.9109542894; 8.47443197124]
Coordinates of the circumscribed circle: U[20.55332631955; 6.39772046345]
Coordinates of the inscribed circle: I[26.70332631955; 9.64400980227]

Exterior (or external, outer) angles of the triangle:
∠ A' = α' = 112.4111242703° = 112°24'40″ = 1.18796463522 rad
∠ B' = β' = 140.3° = 140°18' = 0.6932895713 rad
∠ C' = γ' = 107.2898757297° = 107°17'20″ = 1.26990505884 rad

# How did we calculate this triangle?

The calculation of the triangle progress in two phases. The first phase is such that we try to calculate all three sides of the triangle from the input parameters. The first phase is different for the different triangles query entered. The second phase is the calculation of other characteristics of the triangle, such as angles, area, perimeter, heights, the center of gravity, circle radii, etc. Some input data also results in two to three correct triangle solutions (e.g., if the specified triangle area and two sides - typically resulting in both acute and obtuse) triangle).

### 2. From angle β, side a and side b we calculate side c - by using the law of cosines and quadratic equation:

$b^2 = a^2 + c^2 - 2a c \cos β \ \\ \ \\ 27.5^2 = 39.8^2 + c^2 - 2 \cdot \ 39.8 \cdot \ c \cdot \ \cos 39^\circ 42' \ \\ \ \\ \ \\ c^2 -61.244c +827.79 =0 \ \\ \ \\ p=1; q=-61.244; r=827.79 \ \\ D = q^2 - 4pr = 61.244^2 - 4\cdot 1 \cdot 827.79 = 439.692594849 \ \\ D>0 \ \\ \ \\ c_{1,2} = \dfrac{ -q \pm \sqrt{ D } }{ 2p } = \dfrac{ 61.24 \pm \sqrt{ 439.69 } }{ 2 } \ \\ c_{1,2} = 30.62210229 \pm 10.4844241002 \ \\ c_{1} = 41.106526391 \ \\ c_{2} = 20.1376781907 \ \\ \ \\ \text{ Factored form of the equation: } \ \\ (c -41.106526391) (c -20.1376781907) = 0 \ \\ \ \\ \ \\ c > 0 \ \\ \ \\ c = 41.107$

Now we know the lengths of all three sides of the triangle, and the triangle is uniquely determined. Next, we calculate another its characteristics - same procedure as calculation of the triangle from the known three sides SSS.

### 4. Semiperimeter of the triangle

The semiperimeter of the triangle is half its perimeter. The semiperimeter frequently appears in formulas for triangles that it is given a separate name. By the triangle inequality, the longest side length of a triangle is less than the semiperimeter.

### 5. The triangle area using Heron's formula

Heron's formula gives the area of a triangle when the length of all three sides are known. There is no need to calculate angles or other distances in the triangle first. Heron's formula works equally well in all cases and types of triangles.

### 6. Calculate the heights of the triangle from its area.

There are many ways to find the height of the triangle. The easiest way is from the area and base length. The area of a triangle is half of the product of the length of the base and the height. Every side of the triangle can be a base; there are three bases and three heights (altitudes). Triangle height is the perpendicular line segment from a vertex to a line containing the base.

### 7. Calculation of the inner angles of the triangle using a Law of Cosines

The Law of Cosines is useful for finding the angles of a triangle when we know all three sides. The cosine rule, also known as the law of cosines, relates all three sides of a triangle with an angle of a triangle. The Law of Cosines is the extrapolation of the Pythagorean theorem for any triangle. Pythagorean theorem works only in a right triangle. Pythagorean theorem is a special case of the Law of Cosines and can be derived from it because the cosine of 90° is 0. It is best to find the angle opposite the longest side first. With the Law of Cosines, there is also no problem with obtuse angles as with the Law of Sines, because cosine function is negative for obtuse angles, zero for right, and positive for acute angles. We also use inverse cosine called arccosine to determine the angle from cosine value.

An incircle of a triangle is a circle which is tangent to each side. An incircle center is called incenter and has a radius named inradius. All triangles have an incenter, and it always lies inside the triangle. The incenter is the intersection of the three angle bisectors. The product of the inradius and semiperimeter (half the perimeter) of a triangle is its area.