# Triangle calculator

You have entered side a, c and angle γ.

Triangle has two solutions: a=18.7; b=3.31112488771; c=16.1 and a=18.7; b=27.32550375794; c=16.1.

### #1 Obtuse scalene triangle.

Sides: a = 18.7   b = 3.31112488771   c = 16.1

Area: T = 17.75880279927
Perimeter: p = 38.11112488771
Semiperimeter: s = 19.05656244385

Angle ∠ A = α = 138.2255264641° = 138°13'31″ = 2.41224859774 rad
Angle ∠ B = β = 6.77547353587° = 6°46'29″ = 0.1188241438 rad
Angle ∠ C = γ = 35° = 0.61108652382 rad

Height: ha = 1.89992543308
Height: hb = 10.72658793598
Height: hc = 2.20659662103

Median: ma = 6.90439615123
Median: mb = 17.37697699386
Median: mc = 10.74882409985

Vertex coordinates: A[16.1; 0] B[0; 0] C[18.56994295303; 2.20659662103]
Centroid: CG[11.55664765101; 0.73553220701]
Coordinates of the circumscribed circle: U[8.05; 11.49765914543]
Coordinates of the inscribed circle: I[15.74443755615; 0.93219048058]

Exterior (or external, outer) angles of the triangle:
∠ A' = α' = 41.77547353587° = 41°46'29″ = 2.41224859774 rad
∠ B' = β' = 173.2255264641° = 173°13'31″ = 0.1188241438 rad
∠ C' = γ' = 145° = 0.61108652382 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).

### 1. Input data entered: side a, c and angle γ.

$a = 18.7 \ \\ c = 16.1 \ \\ γ = 35^\circ$

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

$c^2 = a^2 + b^2 - 2a b \cos γ \ \\ \ \\ 16.1^2 = 18.7^2 + b^2 - 2 \cdot \ 18.7 \cdot \ b \cdot \ \cos 35^\circ \ \\ \ \\ \ \\ b^2 -30.636b +90.48 =0 \ \\ \ \\ p=1; q=-30.636; r=90.48 \ \\ D = q^2 - 4pr = 30.636^2 - 4\cdot 1 \cdot 90.48 = 576.662047839 \ \\ D>0 \ \\ \ \\ b_{1,2} = \dfrac{ -q \pm \sqrt{ D } }{ 2p } = \dfrac{ 30.64 \pm \sqrt{ 576.66 } }{ 2 } \ \\ b_{1,2} = 15.31814323 \pm 12.0068943512 \ \\ b_{1} = 27.3250375794 \ \\ b_{2} = 3.31124887705 \ \\ \ \\ \text{ Factored form of the equation: } \ \\ (b -27.3250375794) (b -3.31124887705) = 0 \ \\ \ \\ b > 0 \ \\ \ \\ b = 27.325$

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.

$a = 18.7 \ \\ b = 3.31 \ \\ c = 16.1$

### 3. The triangle perimeter is the sum of the lengths of its three sides

$p = a+b+c = 18.7+3.31+16.1 = 38.11$

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

$s = \dfrac{ p }{ 2 } = \dfrac{ 38.11 }{ 2 } = 19.06$

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

$T = \sqrt{ s(s-a)(s-b)(s-c) } \ \\ T = \sqrt{ 19.06(19.06-18.7)(19.06-3.31)(19.06-16.1) } \ \\ T = \sqrt{ 315.35 } = 17.76$

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

$T = \dfrac{ a h _a }{ 2 } \ \\ \ \\ h _a = \dfrac{ 2 \ T }{ a } = \dfrac{ 2 \cdot \ 17.76 }{ 18.7 } = 1.9 \ \\ h _b = \dfrac{ 2 \ T }{ b } = \dfrac{ 2 \cdot \ 17.76 }{ 3.31 } = 10.73 \ \\ h _c = \dfrac{ 2 \ T }{ c } = \dfrac{ 2 \cdot \ 17.76 }{ 16.1 } = 2.21$

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

$a^2 = b^2+c^2 - 2bc \cos α \ \\ \ \\ α = \arccos(\dfrac{ b^2+c^2-a^2 }{ 2bc } ) = \arccos(\dfrac{ 3.31^2+16.1^2-18.7^2 }{ 2 \cdot \ 3.31 \cdot \ 16.1 } ) = 138^\circ 13'31" \ \\ \ \\ b^2 = a^2+c^2 - 2ac \cos β \ \\ β = \arccos(\dfrac{ a^2+c^2-b^2 }{ 2ac } ) = \arccos(\dfrac{ 18.7^2+16.1^2-3.31^2 }{ 2 \cdot \ 18.7 \cdot \ 16.1 } ) = 6^\circ 46'29" \ \\ γ = 180^\circ - α - β = 180^\circ - 138^\circ 13'31" - 6^\circ 46'29" = 35^\circ$

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.

$T = rs \ \\ r = \dfrac{ T }{ s } = \dfrac{ 17.76 }{ 19.06 } = 0.93$

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.

$R = \dfrac{ a b c }{ 4 \ r s } = \dfrac{ 18.7 \cdot \ 3.31 \cdot \ 16.1 }{ 4 \cdot \ 0.932 \cdot \ 19.056 } = 14.03$

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

$m_a = \dfrac{ \sqrt{ 2b^2+2c^2 - a^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 3.31^2+2 \cdot \ 16.1^2 - 18.7^2 } }{ 2 } = 6.904 \ \\ m_b = \dfrac{ \sqrt{ 2c^2+2a^2 - b^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 16.1^2+2 \cdot \ 18.7^2 - 3.31^2 } }{ 2 } = 17.37 \ \\ m_c = \dfrac{ \sqrt{ 2a^2+2b^2 - c^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 18.7^2+2 \cdot \ 3.31^2 - 16.1^2 } }{ 2 } = 10.748$

### #2 Obtuse scalene triangle.

Sides: a = 18.7   b = 27.32550375794   c = 16.1

Area: T = 146.5432528289
Perimeter: p = 62.12550375794
Semiperimeter: s = 31.06325187897

Angle ∠ A = α = 41.77547353587° = 41°46'29″ = 0.72991066762 rad
Angle ∠ B = β = 103.2255264641° = 103°13'31″ = 1.80216207392 rad
Angle ∠ C = γ = 35° = 0.61108652382 rad

Height: ha = 15.67329976779
Height: hb = 10.72658793598
Height: hc = 18.20440407812

Median: ma = 20.38440952548
Median: mb = 10.8532906538
Median: mc = 21.98657076156

Vertex coordinates: A[16.1; 0] B[0; 0] C[-4.27881887799; 18.20440407812]
Centroid: CG[3.941060374; 6.06880135937]
Coordinates of the circumscribed circle: U[8.05; 11.49765914543]
Coordinates of the inscribed circle: I[3.73774812103; 4.7187664053]

Exterior (or external, outer) angles of the triangle:
∠ A' = α' = 138.2255264641° = 138°13'31″ = 0.72991066762 rad
∠ B' = β' = 76.77547353587° = 76°46'29″ = 1.80216207392 rad
∠ C' = γ' = 145° = 0.61108652382 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).

### 1. Input data entered: side a, c and angle γ.

$a = 18.7 \ \\ c = 16.1 \ \\ γ = 35^\circ$

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

$c^2 = a^2 + b^2 - 2a b \cos γ \ \\ \ \\ 16.1^2 = 18.7^2 + b^2 - 2 \cdot \ 18.7 \cdot \ b \cdot \ \cos 35^\circ \ \\ \ \\ \ \\ b^2 -30.636b +90.48 =0 \ \\ \ \\ p=1; q=-30.636; r=90.48 \ \\ D = q^2 - 4pr = 30.636^2 - 4\cdot 1 \cdot 90.48 = 576.662047839 \ \\ D>0 \ \\ \ \\ b_{1,2} = \dfrac{ -q \pm \sqrt{ D } }{ 2p } = \dfrac{ 30.64 \pm \sqrt{ 576.66 } }{ 2 } \ \\ b_{1,2} = 15.31814323 \pm 12.0068943512 \ \\ b_{1} = 27.3250375794 \ \\ b_{2} = 3.31124887705 \ \\ \ \\ \text{ Factored form of the equation: } \ \\ (b -27.3250375794) (b -3.31124887705) = 0 \ \\ \ \\ b > 0 \ \\ \ \\ b = 27.325$

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.

$a = 18.7 \ \\ b = 27.33 \ \\ c = 16.1$

### 3. The triangle perimeter is the sum of the lengths of its three sides

$p = a+b+c = 18.7+27.33+16.1 = 62.13$

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

$s = \dfrac{ p }{ 2 } = \dfrac{ 62.13 }{ 2 } = 31.06$

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

$T = \sqrt{ s(s-a)(s-b)(s-c) } \ \\ T = \sqrt{ 31.06(31.06-18.7)(31.06-27.33)(31.06-16.1) } \ \\ T = \sqrt{ 21474.71 } = 146.54$

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

$T = \dfrac{ a h _a }{ 2 } \ \\ \ \\ h _a = \dfrac{ 2 \ T }{ a } = \dfrac{ 2 \cdot \ 146.54 }{ 18.7 } = 15.67 \ \\ h _b = \dfrac{ 2 \ T }{ b } = \dfrac{ 2 \cdot \ 146.54 }{ 27.33 } = 10.73 \ \\ h _c = \dfrac{ 2 \ T }{ c } = \dfrac{ 2 \cdot \ 146.54 }{ 16.1 } = 18.2$

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

$a^2 = b^2+c^2 - 2bc \cos α \ \\ \ \\ α = \arccos(\dfrac{ b^2+c^2-a^2 }{ 2bc } ) = \arccos(\dfrac{ 27.33^2+16.1^2-18.7^2 }{ 2 \cdot \ 27.33 \cdot \ 16.1 } ) = 41^\circ 46'29" \ \\ \ \\ b^2 = a^2+c^2 - 2ac \cos β \ \\ β = \arccos(\dfrac{ a^2+c^2-b^2 }{ 2ac } ) = \arccos(\dfrac{ 18.7^2+16.1^2-27.33^2 }{ 2 \cdot \ 18.7 \cdot \ 16.1 } ) = 103^\circ 13'31" \ \\ γ = 180^\circ - α - β = 180^\circ - 41^\circ 46'29" - 103^\circ 13'31" = 35^\circ$

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.

$T = rs \ \\ r = \dfrac{ T }{ s } = \dfrac{ 146.54 }{ 31.06 } = 4.72$

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.

$R = \dfrac{ a b c }{ 4 \ r s } = \dfrac{ 18.7 \cdot \ 27.33 \cdot \ 16.1 }{ 4 \cdot \ 4.718 \cdot \ 31.063 } = 14.03$

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

$m_a = \dfrac{ \sqrt{ 2b^2+2c^2 - a^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 27.33^2+2 \cdot \ 16.1^2 - 18.7^2 } }{ 2 } = 20.384 \ \\ m_b = \dfrac{ \sqrt{ 2c^2+2a^2 - b^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 16.1^2+2 \cdot \ 18.7^2 - 27.33^2 } }{ 2 } = 10.853 \ \\ m_c = \dfrac{ \sqrt{ 2a^2+2b^2 - c^2 } }{ 2 } = \dfrac{ \sqrt{ 2 \cdot \ 18.7^2+2 \cdot \ 27.33^2 - 16.1^2 } }{ 2 } = 21.986$