Law of Sines Calculator – Solve Oblique Triangles in Three Modes
The Law of Sines is a fundamental relationship in trigonometry that connects the side lengths of any triangle to the sines of their opposite angles. Unlike the Pythagorean theorem, which only works for right triangles, the Law of Sines applies to all triangles — acute, obtuse, and right alike. This calculator solves oblique (non-right) triangles given two angles and a side (AAS or ASA), or two sides and a non-included angle (SSA), returning all three angles, all three sides, area, perimeter, and the common sine rule ratio.
The Law of Sines Formula
For a triangle with vertices A, B, C and opposite sides a, b, c respectively, the Law of Sines states:
a / sin(A) = b / sin(B) = c / sin(C) = 2R
where R is the circumradius — the radius of the circle that passes through all three vertices. This common ratio is constant for any given triangle. Once you know any two angles and one side (or the appropriate SSA data), every other measurement follows directly.
AAS — Angle-Angle-Side
When you know two angles and a non-included side (a side that is not between the two known angles), the triangle is fully determined. The calculator proceeds as follows:
- Compute the third angle:
C = 180° − A − B. - Apply the sine rule to find the remaining sides:
b = a · sin(B) / sin(A)andc = a · sin(C) / sin(A). - Compute area, perimeter, and the sine ratio
a / sin(A).
Example: A = 45°, B = 60°, a = 7 → C = 75°, b ≈ 8.5735, c ≈ 9.5882.
ASA — Angle-Side-Angle
When you know two angles and the included side (the side between the two known angles), the triangle is also uniquely determined:
- Compute the third angle:
B = 180° − A − C. - Use the sine rule:
a = b · sin(A) / sin(B)andc = b · sin(C) / sin(B).
Example: A = 50°, C = 70°, b = 12 → B = 60°, a ≈ 10.6066, c ≈ 13.0541.
SSA — The Ambiguous Case
The SSA configuration — knowing two sides and a non-included angle — is called the ambiguous case because the given data may satisfy zero, one, or two distinct triangles. The calculator uses the following logic (given angle A, side a opposite A, and side b):
- Compute the altitude:
h = b · sin(A). - No solution:If A < 90° and a < h, no triangle is possible — the opposite side is too short to reach the base.
- One right-triangle solution: If a = h exactly, angle B is 90° and a unique right triangle exists.
- Two solutions:If A < 90° and h < a < b, two different triangles satisfy the given data — one with an acute angle B and one with its supplement (180° − B).
- One solution:If a ≥ b, or if A ≥ 90° and a > b, a unique triangle exists.
When two solutions exist, the calculator displays both triangles side by side with separate result tables and labeled SVG diagrams.
Area, Perimeter, and the Sine Ratio
Once all three sides and angles are resolved, the calculator computes:
- Area:
Area = (1/2) · b · c · sin(A) - Perimeter:
P = a + b + c - Semi-perimeter:
s = P / 2 - Sine rule ratio:
a / sin(A)— confirms that b/sin(B) and c/sin(C) yield the same value, equal to 2R.
Angle Units and Length Units
All angle inputs and outputs can be given in degrees or radians. The calculator performs every computation internally in radians (using JavaScript's native Math.sin and Math.acos) and converts back for display. Length units — mm, cm, m, km, in, ft, yd — are cosmetic labels; the numeric results scale proportionally to whatever unit you supply.
Practical Applications
The Law of Sines underpins many real-world calculations:
- Surveying and navigation: Triangulation uses two known angles (from reference points) and a measured baseline to pinpoint a third location — the classic ASA setup.
- Engineering and architecture: Roof trusses, bridge supports, and geodesic structures frequently involve oblique triangles where a known angle and span determine the remaining dimensions.
- Astronomy: Computing distances to celestial objects (parallax method) relies on triangle geometry identical to AAS problems.
- Education: The Law of Sines and the ambiguous case are standard topics in trigonometry and pre-calculus courses. This tool provides instant verification for worked examples.
How to Read the SVG Diagram
Each solution is accompanied by a labeled triangle diagram. Vertices A, B, and C are annotated with their solved angle values; sides a (BC), b (AC), and c (AB) are labeled along each edge. The diagram scales automatically to fit any triangle shape. When the SSA ambiguous case yields two solutions, two separate diagrams appear — one for each valid triangle — making it easy to compare the two possibilities visually.
Accuracy and Validation
All computations use JavaScript's 64-bit IEEE 754 double-precision floating-point arithmetic, providing approximately 15 significant digits of precision. Inputs are validated before calculation: angles must be positive and their sum must not exceed 180° (or π rad); side lengths must be positive; and the SSA height check is enforced with a clear no-solution message when applicable.