Law of Tangents Calculator

Enter two sides and the included angle C to solve for angles A and B using the Law of Tangents, plus the third side c.

🔻 Law of Tangents Calculator
Side a
0.1100
Side b
0.1100
Angle C
°
179°
Angle A
Angle B
Side c
A + B (= 180° − C)

🔻 What is the Law of Tangents Calculator?

The Law of Tangents calculator solves the classic SAS (side-angle-side) triangle case, two known sides a and b plus the included angle C, by finding the two remaining angles A and B individually. It applies the Law of Tangents, also called Napier's analogy after the mathematician John Napier, which relates the difference and sum of two sides directly to the tangent of half the difference and half the sum of their opposite angles.

This calculator is useful for trigonometry and precalculus students studying triangle-solving techniques beyond the more common Law of Sines and Law of Cosines, for surveyors and navigators who still encounter Napier's analogy in classical formulas, and for anyone who wants to verify a Law of Cosines answer using an independent method.

A common misconception is that the Law of Tangents can only find the angle difference A-B, leaving A and B individually unknown. In fact, since A+B = 180° - C is already known from the triangle angle sum, solving for A-B with the tangent formula is enough to recover both A and B separately by simple addition and subtraction.

Enter side a, side b, and the included angle C, and this calculator instantly returns angle A, angle B, the third side c (computed via the Law of Cosines for a complete solution), and the intermediate A+B value used in the derivation.

📐 Formula

(a − b) / (a + b)  =  tan[(A−B)/2] / tan[(A+B)/2]
a, b = the two known sides
A, B = the angles opposite sides a and b (both unknown)
C = the known included angle, so A + B = 180° − C
Solve steps: A+B = 180°−C  →  tan[(A−B)/2] = [(a−b)/(a+b)]·tan[(A+B)/2]  →  A = [(A+B)+(A−B)]/2, B = [(A+B)−(A−B)]/2
Example: a=8.66, b=7.07, C=75°: A+B=105°, A−B=15°, so A=60° and B=45°.

📖 How to Use This Calculator

Steps

1
Enter the two known sides, type side a and side b, using the same length unit for both.
2
Enter the included angle C, type angle C in degrees, the angle between the two unknown angles A and B.
3
Read angles A and B, see the two remaining angles, the third side c, and the A+B step used in the derivation.

💡 Example Calculations

Example 1 - A 60-45-75 triangle

a=8.66, b=7.07, C=75°

1
A+B = 180° − 75° = 105°.
2
tan[(A−B)/2] = [(8.66−7.07)/(8.66+7.07)] × tan(52.5°) → A−B ≈ 15.00°.
3
A = (105+15)/2 = 60.00°, B = (105−15)/2 = 45.00°, and c = √(a²+b²−2ab·cos C) = 9.66.
A = 60.00°, B = 45.00°, c = 9.66
Try this example →

Example 2 - A wide-angle triangle

a=10, b=7, C=40°

1
A+B = 180° − 40° = 140°.
2
tan[(A−B)/2] = [(10−7)/(10+7)] × tan(70°) → A−B ≈ 51.73°.
3
A = (140+51.73)/2 = 95.87°, B = (140−51.73)/2 = 44.13°, and c = 6.46.
A = 95.87°, B = 44.13°, c = 6.46
Try this example →

Example 3 - An obtuse included angle

a=15, b=9, C=100°

1
A+B = 180° − 100° = 80°.
2
tan[(A−B)/2] = [(15−9)/(15+9)] × tan(40°) → A−B ≈ 23.69°.
3
A = (80+23.69)/2 = 51.85°, B = (80−23.69)/2 = 28.15°, and c = 18.79.
A = 51.85°, B = 28.15°, c = 18.79
Try this example →

❓ Frequently Asked Questions

What is the Law of Tangents?+
The Law of Tangents relates the difference and sum of two sides of a triangle to the tangent of half the difference and half the sum of their opposite angles: (a-b)/(a+b) = tan[(A-B)/2] / tan[(A+B)/2]. It is also known as Napier's analogy.
What is the formula for the Law of Tangents?+
(a-b)/(a+b) = tan[(A-B)/2] / tan[(A+B)/2], where a and b are two sides and A, B are their opposite angles. Given a, b, and the included angle C, A+B = 180°-C is known, so the formula solves for A-B, and then A and B individually.
When should I use the Law of Tangents instead of the Law of Cosines?+
Both solve the same SAS (two sides, included angle) case. The Law of Cosines is the standard modern approach since it needs only one formula and a calculator. The Law of Tangents remains useful for its clean derivation of A-B and was historically faster with logarithm tables.
What inputs does the Law of Tangents calculator need?+
Two sides, a and b, and the included angle C between the two unknown angles A and B. From these it computes A+B = 180°-C, then applies the tangent formula to find A-B, and finally A and B individually.
How do you find angle A and angle B using the Law of Tangents?+
First compute A+B = 180°-C. Then compute A-B using tan[(A-B)/2] = [(a-b)/(a+b)]·tan[(A+B)/2]. Finally, A = [(A+B)+(A-B)]/2 and B = [(A+B)-(A-B)]/2.
Can the Law of Tangents find the third side of a triangle?+
Not directly, the Law of Tangents formula itself only relates angles and the two given sides. This calculator additionally applies the Law of Cosines (c² = a² + b² - 2ab·cos C) to return the third side c as well.
What happens in the Law of Tangents formula if side a equals side b?+
If a = b, then (a-b)/(a+b) = 0, so tan[(A-B)/2] = 0, meaning A-B = 0 and A = B. This correctly identifies an isosceles triangle where the two base angles are equal.
Is the Law of Tangents still useful today?+
With calculators and computers, the Law of Cosines is simpler for most SAS triangle problems since it avoids the half-angle steps. The Law of Tangents is still taught for its elegant structure and is occasionally preferred in surveying and navigation formulas.
What is Napier's analogy in trigonometry?+
Napier's analogy is another name for the Law of Tangents, named after mathematician John Napier, who also invented logarithms. It pairs naturally with logarithms because it turns a division into a form that was fast to compute using log tables.
What happens if angle C is 0 or 180 degrees in this calculator?+
Both are invalid, a triangle cannot have an angle of exactly 0° or 180°, since the other two angles could not form a closed shape. This calculator requires C to be strictly between 0° and 180° and shows an error otherwise.
Does side order matter in the Law of Tangents formula?+
Yes, side a must be opposite the angle you call A, and side b opposite angle B. Swapping a and b simply swaps which angle comes out larger, the triangle itself is unchanged.

What is the Law of Tangents?

The Law of Tangents relates the difference and sum of two sides of a triangle to the tangent of half the difference and half the sum of their opposite angles: (a-b)/(a+b) = tan[(A-B)/2] / tan[(A+B)/2]. It is also known as Napier's analogy.

What is the formula for the Law of Tangents?

(a-b)/(a+b) = tan[(A-B)/2] / tan[(A+B)/2], where a and b are two sides and A, B are their opposite angles. Given a, b, and the included angle C, A+B = 180°-C is known, so the formula solves for A-B, and then A and B individually.

When should I use the Law of Tangents instead of the Law of Cosines?

Both solve the same SAS (two sides, included angle) case. The Law of Cosines is the standard modern approach since it needs only one formula and a calculator. The Law of Tangents remains useful for its clean derivation of A-B and was historically faster with logarithm tables.

What inputs does the Law of Tangents calculator need?

Two sides, a and b, and the included angle C between the two unknown angles A and B. From these it computes A+B = 180°-C, then applies the tangent formula to find A-B, and finally A and B individually.

How do you find angle A and angle B using the Law of Tangents?

First compute A+B = 180°-C. Then compute A-B using tan[(A-B)/2] = [(a-b)/(a+b)]·tan[(A+B)/2]. Finally, A = [(A+B)+(A-B)]/2 and B = [(A+B)-(A-B)]/2.

Can the Law of Tangents find the third side of a triangle?

Not directly, the Law of Tangents formula itself only relates angles and the two given sides. This calculator additionally applies the Law of Cosines (c² = a² + b² - 2ab·cos C) to return the third side c as well.

What happens in the Law of Tangents formula if side a equals side b?

If a = b, then (a-b)/(a+b) = 0, so tan[(A-B)/2] = 0, meaning A-B = 0 and A = B. This correctly identifies an isosceles triangle where the two base angles are equal.

Is the Law of Tangents still useful today?

With calculators and computers, the Law of Cosines is simpler for most SAS triangle problems since it avoids the half-angle steps. The Law of Tangents is still taught for its elegant structure and is occasionally preferred in surveying and navigation formulas.

What is Napier's analogy in trigonometry?

Napier's analogy is another name for the Law of Tangents, named after mathematician John Napier, who also invented logarithms. It pairs naturally with logarithms because it turns a division into a form that was fast to compute using log tables.

What happens if angle C is 0 or 180 degrees in this calculator?

Both are invalid, a triangle cannot have an angle of exactly 0° or 180°, since the other two angles could not form a closed shape. This calculator requires C to be strictly between 0° and 180° and shows an error otherwise.

Does side order matter in the Law of Tangents formula?

Yes, side a must be opposite the angle you call A, and side b opposite angle B. Swapping a and b simply swaps which angle comes out larger, the triangle itself is unchanged.