{
  "id": "law-of-sines",
  "version": "1a7f810057d6",
  "status": "published",
  "name": "Law of Sines Calculator",
  "question": "How do I use the law of sines?",
  "summary": "Solves a triangle with the law of sines from two angles and a side (AAS or ASA), or from two sides and an opposite angle (SSA), showing both triangles in the ambiguous case.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/law-of-sines-calculator",
  "markdown": "https://www.acalculator.org/math/law-of-sines-calculator.md",
  "kind": "function",
  "method": "Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C. Two angles and a side: C = 180° − A − B, then each side = known side ÷ sin(its angle) × sin(the opposite angle). Two sides and angle A: sin B = b sin A ÷ a; B = arcsin, and also 180° − arcsin when A is acute and b sin A < a < b.",
  "assumptions": [
    "Angles are typed in degrees or radians, each more than 0° and less than 180°.",
    "Sides are in any one unit, from 10⁻⁹ to 10⁹; the area is in that unit squared.",
    "Sines at multiples of 15° are exact, and an angle within one part in 10¹² of a multiple of 15° (other than 0°) counts as that multiple.",
    "In the ambiguous case (two sides and an angle), sin B is taken as 1 when it is within 10⁻¹² of 1, giving one right triangle."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "What do you know?",
        "description": "Two angles and one side, or two sides and the angle opposite the first of them.",
        "type": "string",
        "enum": [
          "aas",
          "ssa"
        ]
      },
      "A": {
        "title": "Angle A",
        "description": "The angle opposite side a.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "exclusiveMinimum": 0,
        "exclusiveMaximum": 3.141592653589793
      },
      "B": {
        "title": "Angle B",
        "description": "The angle opposite side b.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "exclusiveMinimum": 0,
        "exclusiveMaximum": 3.141592653589793
      },
      "side": {
        "title": "Which side do you know?",
        "description": "Side a (opposite A), side b (opposite B), or side c (between angles A and B).",
        "type": "string",
        "enum": [
          "a",
          "b",
          "c"
        ]
      },
      "len": {
        "title": "Length of that side",
        "description": "The length of the side you know, in any unit.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 1000000000
      },
      "a": {
        "title": "Side a",
        "description": "The side opposite angle A, in any unit.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 1000000000
      },
      "b": {
        "title": "Side b",
        "description": "The other known side, opposite angle B, in the same unit.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "c": {
      "label": "Side c",
      "description": "The side opposite angle C.",
      "format": "number"
    },
    "a": {
      "label": "Side a",
      "description": "The side opposite angle A.",
      "format": "number"
    },
    "b": {
      "label": "Side b",
      "description": "The side opposite angle B.",
      "format": "number"
    },
    "A": {
      "label": "Angle A",
      "description": "The angle opposite side a.",
      "format": "quantity",
      "unit": "deg"
    },
    "B": {
      "label": "Angle B",
      "description": "The angle opposite side b.",
      "format": "quantity",
      "unit": "deg"
    },
    "C": {
      "label": "Angle C",
      "description": "The angle opposite side c: 180° − A − B.",
      "format": "quantity",
      "unit": "deg"
    },
    "area": {
      "label": "Area",
      "description": "Half of a × b × sin C, in square units of the sides.",
      "format": "number"
    },
    "triangles": {
      "label": "Triangles",
      "description": "How many triangles fit the given parts: one, or two in the ambiguous case (SSA).",
      "format": "text"
    },
    "B2": {
      "label": "Second triangle: angle B",
      "description": "In the ambiguous case, the other angle B: 180° minus the first.",
      "format": "quantity",
      "unit": "deg"
    },
    "C2": {
      "label": "Second triangle: angle C",
      "description": "In the ambiguous case, 180° − A − the second angle B.",
      "format": "quantity",
      "unit": "deg"
    },
    "c2": {
      "label": "Second triangle: side c",
      "description": "In the ambiguous case, side c of the second triangle.",
      "format": "number"
    },
    "area2": {
      "label": "Second triangle: area",
      "description": "In the ambiguous case, the area of the second triangle.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "aas",
      "A": 0.8726646259971648,
      "B": 1.7453292519943295,
      "side": "a",
      "len": 10,
      "a": 6,
      "b": 8
    },
    "outputs": {
      "c": 6.527036446661393,
      "a": 10,
      "b": 12.855752193730787,
      "A": 0.8726646259971648,
      "B": 1.7453292519943295,
      "C": 0.5235987755982989,
      "area": 32.13938048432696,
      "triangles": "One triangle"
    },
    "text": "The triangle has sides a = 10, b = 12.8558, c = 6.52704 and angles A = 50°, B = 100°, C = 30°."
  },
  "examples": [
    {
      "given": {
        "mode": "aas",
        "A": 0.8726646259971648,
        "B": 1.7453292519943295,
        "side": "a",
        "len": 10
      },
      "expect": {
        "C": 0.5235987755982988,
        "b": 12.855752193730787,
        "c": 6.527036446661393,
        "area": 32.13938048432696
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.1 Non-right Triangles: Law of Sines, Example 1 (b ≈ 12.9, c ≈ 6.5), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines; Python 3: 10*sin(100°)/sin(50°), 10*0.5/sin(50°)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "mode": "ssa",
        "A": 0.6108652381980153,
        "a": 6,
        "b": 8
      },
      "expect": {
        "triangles": "Two triangles",
        "B": 0.8706820789356209,
        "C": 1.6600453364561567,
        "c": 10.41904674200633,
        "B2": 2.270910574654172,
        "C2": 0.2598168407376056,
        "c2": 2.687385966617538
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.1, Example 2 (β ≈ 49.9°, γ ≈ 95.1°, c ≈ 10.4; or β ≈ 130.1°, γ ≈ 14.9°, c ≈ 2.7), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines; Python 3 cross-check in docs/progress/WP-63.md",
      "tolerance": 1e-12
    },
    {
      "given": {
        "mode": "ssa",
        "A": 1.4835298641951802,
        "a": 12,
        "b": 9
      },
      "expect": {
        "triangles": "One triangle",
        "B": 0.8437577627828732,
        "C": 0.8143050266117398,
        "c": 8.760320816904573
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.1, Example 3 (b = 9, c = 12, γ = 85°: β ≈ 48.3°, α ≈ 46.7°, a ≈ 8.8), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines",
      "tolerance": 1e-12
    },
    {
      "given": {
        "mode": "ssa",
        "A": 0.5235987755982988,
        "a": 4,
        "b": 8
      },
      "expect": {
        "triangles": "One right triangle",
        "B": 1.5707963267948966,
        "C": 1.0471975511965976,
        "c": 6.928203230275509
      },
      "source": "hand calculation in content.mdx: sin B = 8 × (1/2) ÷ 4 = 1, B = 90°, c = 4 × sin 60° ÷ sin 30° = 4√3; OpenStax, Algebra and Trigonometry 2e, §10.1 (one triangle when the side equals the altitude), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines",
      "tolerance": 1e-12
    },
    {
      "given": {
        "mode": "aas",
        "A": 0.7853981633974483,
        "B": 1.0471975511965976,
        "side": "c",
        "len": 10
      },
      "expect": {
        "C": 1.3089969389957472,
        "a": 7.320508075688772,
        "b": 8.965754721680534
      },
      "source": "hand calculation in content.mdx: C = 75°, a = 10 sin 45° ÷ sin 75° = 10(√3 − 1), b = 10 sin 60° ÷ sin 75°; OpenStax, Algebra and Trigonometry 2e, §10.1, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §10.1 Non-right Triangles: Law of Sines (the law, the ambiguous case, Examples 1 to 3, and the area formula). https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines (retrieved 2026-10-01)",
    "OpenStax, Algebra and Trigonometry 2e, §8.3 Inverse Trigonometric Functions (arcsin gives an angle from −90° to 90°). https://openstax.org/books/algebra-and-trigonometry-2e/pages/8-3-inverse-trigonometric-functions (retrieved 2026-10-01)"
  ],
  "related": [
    "law-of-cosines",
    "triangle",
    "sine",
    "inverse-sine"
  ],
  "changelog": []
}
