Skip to content
Formulaxis

Toolbox

Triangle: calculating sides, angles and area

Find the dimensions of a plane triangle from three sides (SSS), two sides and their included angle (SAS), or angles A and B with side a. The calculation completes the given data and provides area and perimeter.

Created on , Revised on v2.0

Method and validation

Triangle: calculating sides, angles and area

Strictly positive length of the side opposite angle A.

Strictly positive length of the side opposite B; it forms angle C with a in SAS mode.

Third side in SSS mode, opposite C; it must be less than a + b.

Initial values are examples.

Results

Angle A, opposite a A
38.21°
Angle B, opposite b B
60°
Angle C, opposite c C
81.79°
Triangle area S
17.32cm²
Perimeter P
20cm

Substitution in SI units

A=acos(min(1,max(−1,(0.07 m)2+(0.08 m)2−(0.05 m)22×(0.07 m)×(0.08 m))))=38.21 °

Nondegenerate plane triangles only.

Side and angle convention

Triangle: calculating sides, angles and area · SSS — three sides a, b, cRelative lengths and angles reproduce the calculated triangle. Sides a = BC, b = CA, c = AB.cabABCa = 5 cm · b = 7 cm · c = 8 cm

Relative lengths and angles reproduce the calculated triangle. Sides a = BC, b = CA, c = AB.

Illustrative diagram, not to scale.

Estimated reading time : 6 min · 1088 words

Calculation details

Identify each side by its opposite angle: a opposite A, b opposite B, c opposite C. In SAS mode, the given angle is C, between a and b.

01 · Angle A, opposite a

FORMULA

A=acos(min(1,max(−1,b2+c2−a22×b×c)))

NUMERICAL SUBSTITUTION

A=acos(min(1,max(−1,(7 cm)2+(8 cm)2−(5 cm)22×(7 cm)×(8 cm))))

RESULT

A=38.21 °

02 · Angle B, opposite b

FORMULA

B=acos(min(1,max(−1,a2+c2−b22×a×c)))

NUMERICAL SUBSTITUTION

B=acos(min(1,max(−1,(5 cm)2+(8 cm)2−(7 cm)22×(5 cm)×(8 cm))))

RESULT

B=60 °

03 · Angle C, opposite c

FORMULA

C=acos(min(1,max(−1,a2+b2−c22×a×b)))

NUMERICAL SUBSTITUTION

C=acos(min(1,max(−1,(5 cm)2+(7 cm)2−(8 cm)22×(5 cm)×(7 cm))))

RESULT

C=81.79 °

04 · Triangle area

FORMULA

S=a×b×sin(acos(min(1,max(−1,a2+b2−c22×a×b))))2

NUMERICAL SUBSTITUTION

S=(5 cm)×(7 cm)×sin(acos(min(1,max(−1,(5 cm)2+(7 cm)2−(8 cm)22×(5 cm)×(7 cm)))))2

RESULT

S=17.32 cm2

05 · Perimeter

FORMULA

P=a+b+c

NUMERICAL SUBSTITUTION

P=(5 cm)+(7 cm)+(8 cm)

RESULT

P=20 cm

Identify the sides and choose the known values

The vertices are labeled A, B and C; side a is opposite vertex A, and likewise for b and c. In SAS mode, enter a and b and the angle C included between them. In the two-angle mode, enter A, B and side a opposite A. The entered lengths remain visible among the data; only missing quantities are added to the results.

Formulas and symbols

The following relationships use the symbols defined below.

A=acos(min(1,max(−1,b2+c2−a22×b×c)))Angle A, opposite side a.

B=acos(min(1,max(−1,a2+c2−b22×a×c)))Angle B, opposite side b.

C=acos(min(1,max(−1,a2+b2−c22×a×b)))Angle C, opposite side c.

S=a×b×sin(acos(min(1,max(−1,a2+b2−c22×a×b))))2(triangle area)

P=a+b+c(perimeter)

c=a2+b2−2×a×b×cos(C)(side c)

A=acos(min(1,max(−1,b2+a2+b2−2×a×b×cos(C)2−a22×b×a2+b2−2×a×b×cos(C))))Angle A, opposite side a.

B=acos(min(1,max(−1,a2+a2+b2−2×a×b×cos(C)2−b22×a×a2+b2−2×a×b×cos(C))))Angle B, opposite side b.

S=a×b×sin(C)2(triangle area)

P=a+b+a2+b2−2×a×b×cos(C)(perimeter)

b=a×sin(B)sin(A)(side b)

c=a×sin(acos(−1)−A−B)sin(A)(side c)

C=acos(−1)−A−BAngle C, opposite side c.

S=a×a×sin(B)sin(A)×sin(acos(−1)−A−B)2(triangle area)

P=a+a×sin(B)sin(A)+a×sin(acos(−1)−A−B)sin(A)(perimeter)

  • a, b, c: lengths of the sides opposite angles A, B, C.
  • S: area.
  • P: perimeter. Angles entered in degrees or radians are converted before trigonometric functions. The law of cosines gives the angles in SSS mode and the missing side in SAS mode; the law of sines gives b and c when A, B and a are known. In the formulas, alpha denotes A, beta denotes B and gamma denotes C.

Sufficient data and method

ModeData to enterMain method
SSSa, b, cLaw of cosines
SASa, b, included CCosines, then angles
Two angles and one sideA, B, a opposite AAngle sum and sines
Three angles onlyA, B, CScale undetermined; unsupported
Two sides, nonincluded angleSSAPotentially ambiguous; unsupported

OpenStax — law of cosines and area ; OpenStax — law of sines.

Worked examples

Example 1: Triangle with sides 5, 7 and 8 cm

The perimeter is 20 cm. The semiperimeter is 10 cm; Heron’s formula gives 10×5×3×2, or 103 cm2, approximately 17,32 cm2. The angles are approximately 38,21°, 60° and 81,79°.

Example 2: Two perpendicular sides

For a=3 cm, b=4 cm and C=90 °, c is 5 cm. The area is 6 cm2 and the perimeter is 12 cm. Angles A and B are approximately 36,87° and 53,13°.

Example 3: 30°–60°–90° triangle

With A=30 °, B=60 ° and a=5 cm, C is 90°, b is 53 cm and c is 10 cm. The area is approximately 21,65 cm2 and the perimeter 23,66 cm.

Assumptions and limitations

Nondegenerate plane triangles only. Every side must be strictly positive and, in SSS, less than the sum of the other two. Angles must lie strictly between 0° and 180°; in two-angle mode, their sum must be less than 180°. Ambiguous SSA cases and three angles without a side are not handled. Near a flattened triangle, results become sensitive to rounding.

Common mistakes

In SAS, C is the angle between a and b, not the angle opposite either side. Do not apply Pythagoras without a right angle. A side of 8 cm cannot complete sides of 3 and 4 cm. Use consistent units or explicitly select the unit of each length.

Frequently asked questions

Why are three angles insufficient?

They define a shape but not its scale. All triangles obtained by multiplying the sides by the same factor have the same angles.

Which angle should be entered with two sides?

In the offered SAS mode, angle C must lie between sides a and b. A non-included angle is a different problem that may have two solutions.

How can triangle results be checked?

Angles sum to a straight angle and the largest side faces the largest angle. Check perimeter by summing sides and area using an independent height.

Why is a nearly flat triangle sensitive?

Height and area become small when two sides nearly sum to the third. Small measurement errors can then cause large relative changes.