Law of Sines and Cosines Calculator (Triangle Solver)

Solve any triangle by entering sides or angles. Discover the remaining measures, area, perimeter, and the correct theorem with step-by-step logic.

Engine Interativa

Enter exactly 3 values (it is mandatory to include at least one side) to calculate the remaining data of the triangle:

This interactive tool analyzes the geometric properties of oblique triangles (acute or obtuse) based on any three known components. The mathematical engine validates the triangle’s existence through the triangle inequality theorem and dynamically determines the correct trigonometric laws required to find missing sides and angles.

Academic Content: Advanced Resolution of Oblique Triangles

Introduction to General Triangle Trigonometry

Unlike right triangles, where sine, cosine, and tangent relations depend directly on a right angle (90°), oblique triangles require generalized methods for their resolution. Determining all the dimensions of a triangle from partial data is a classic problem in civil engineering, surveying, computer graphics, and autonomous navigation.

To solve these geometric systems, we use two fundamental theorems: the Law of Sines and the Law of Cosines.


1. Law of Cosines (Generalized Pythagorean Theorem)

The Law of Cosines relates the three sides of a triangle to the cosine of one of its interior angles. It acts as a direct extension of the Pythagorean Theorem, applying a correction factor for triangles that do not feature right angles.

Mathematical Formulas

For a triangle with sides a, b, c and opposite angles A, B, C respectively:

  • a² = b² + c² - 2bc · cos(A)
  • b² = a² + c² - 2ac · cos(B)
  • c² = a² + b² - 2ab · cos(C)

When to Apply the Law of Cosines?

You should select this method in the following input scenarios:

  1. SSS Case (Side, Side, Side): When the length of all three sides is known and you want to find the interior angles.
  2. SAS Case (Side, Angle, Side): When you know two sides and the exact angle formed between them.

2. Law of Sines

The Law of Sines states that in any triangle, the ratios of the lengths of the sides to the sines of their respective opposite angles are constant and proportional to the diameter of the triangle’s circumscribed circle.

Mathematical Formula

  • a / sin(A) = b / sin(B) = c / sin(C)

When to Apply the Law of Sines?

This theorem is ideal for the following configurations:

  1. ASA Case (Angle, Side, Angle): When two known angles flank a specific known side.
  2. AAS Case (Angle, Angle, Side): When we know two angles and a side that is opposite to one of them.

Algorithmic Decision Matrix (SEO Target)

The table below summarizes how our computation engine decides which logical approach to adopt at the moment the calculation is triggered:

Structural CaseInitial User DataInitial Theorem AppliedObjective of the First Step
SSSSide a, Side b, Side cLaw of CosinesIsolate and find the first angle (A)
SASSides b and c + Angle ALaw of CosinesCalculate the length of the opposite side (a)
ASAAngles A and B + Side cSum of Angles (180°)Determine the third missing angle (C)
AASAngles A and B + Side aLaw of SinesIsolate the second opposite side (b)

Geometric Validation and the Triangle Inequality

No trigonometric algorithm can safely execute calculations without passing through the Triangle Inequality Theorem filter. Theoretically, for a triangle to exist, the sum of the lengths of any two sides must be strictly greater than the length of the remaining third side.

  • Mathematical expression: (a + b > c) AND (a + c > b) AND (b + c > a)

If this core rule is violated by the user’s inputs, the tool will throw a mathematical exception, preventing inconsistent data from corrupting engineering designs or structural calculations.


Calculating Secondary Attributes: Area and Perimeter

After fully resolving all sides, the system computes the following derivative properties:

Perimeter

The perimeter (P) is the total linear magnitude of the triangle’s boundary:

  • P = a + b + c

Area via Heron’s Formula

When the direct height of the triangle is unavailable, the software adopts Heron’s Equation, which utilizes the semiperimeter (s = P / 2):

  • Area = √[ s · (s - a) · (s - b) · (s - c) ]