{
  "id": "trigonometry",
  "version": "85579f61736f",
  "status": "published",
  "name": "Trigonometry Calculator",
  "question": "What are my trigonometry values?",
  "summary": "Finds sin, cos, tan, csc, sec, and cot of any angle in degrees or radians, with exact values for multiples of 15°, or the ratios and angle of a right triangle from two sides (SOH CAH TOA).",
  "category": "math",
  "subcategory": "trigonometry",
  "url": "https://www.acalculator.org/math/trigonometry-calculator",
  "markdown": "https://www.acalculator.org/math/trigonometry-calculator.md",
  "kind": "function",
  "method": "On the unit circle, sin θ = y and cos θ = x; tan θ = sin θ ÷ cos θ, csc θ = 1 ÷ sin θ, sec θ = 1 ÷ cos θ, cot θ = 1 ÷ tan θ. In a right triangle, SOH CAH TOA: sin = opposite ÷ hypotenuse, cos = adjacent ÷ hypotenuse, tan = opposite ÷ adjacent.",
  "assumptions": [
    "Angles can be typed in degrees or radians, and can be negative or more than 360°.",
    "An angle within one part in 10¹² of a multiple of 15° is taken as that multiple, so the values there are exact (sin 180° = 0, tan 90° undefined).",
    "A function that is undefined at the angle (tan 90°, cot 0°) shows no value."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "Start from",
        "description": "An angle, or two sides of a right triangle.",
        "type": "string",
        "enum": [
          "angle",
          "sides"
        ]
      },
      "theta": {
        "title": "Angle θ",
        "description": "Any angle, in degrees or radians; negative angles turn clockwise.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "minimum": -1000000,
        "maximum": 1000000
      },
      "pair": {
        "title": "Which two sides do you know?",
        "description": "The two sides of the right triangle you know; the third is found.",
        "type": "string",
        "enum": [
          "oa",
          "oh",
          "ah"
        ]
      },
      "opp": {
        "title": "Opposite side",
        "description": "The side of the right triangle across from angle θ.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "adj": {
        "title": "Adjacent side",
        "description": "The side next to angle θ that is not the hypotenuse.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "hyp": {
        "title": "Hypotenuse",
        "description": "The longest side, across from the right angle.",
        "type": "number",
        "exclusiveMinimum": 0
      }
    }
  },
  "outputs": {
    "sin": {
      "label": "sin θ",
      "description": "Sine: opposite ÷ hypotenuse, the y value on the unit circle.",
      "format": "number"
    },
    "cos": {
      "label": "cos θ",
      "description": "Cosine: adjacent ÷ hypotenuse, the x value on the unit circle.",
      "format": "number"
    },
    "tan": {
      "label": "tan θ",
      "description": "Tangent: opposite ÷ adjacent = sin ÷ cos. Undefined at 90° and 270°.",
      "format": "number"
    },
    "csc": {
      "label": "csc θ",
      "description": "Cosecant: 1 ÷ sin. Undefined at 0° and 180°.",
      "format": "number"
    },
    "sec": {
      "label": "sec θ",
      "description": "Secant: 1 ÷ cos. Undefined at 90° and 270°.",
      "format": "number"
    },
    "cot": {
      "label": "cot θ",
      "description": "Cotangent: 1 ÷ tan = cos ÷ sin. Undefined at 0° and 180°.",
      "format": "number"
    },
    "exact": {
      "label": "Exact values",
      "description": "The six values as exact fractions and square roots, for multiples of 15° or whole-number sides.",
      "format": "text"
    },
    "angle": {
      "label": "Angle θ",
      "description": "The angle: as typed, or from the two sides (θ = arctan(opposite ÷ adjacent)).",
      "format": "quantity",
      "unit": "deg"
    },
    "reference": {
      "label": "Reference angle",
      "description": "The acute angle between θ and the x-axis, from 0° to 90°.",
      "format": "quantity",
      "unit": "deg"
    },
    "coterminal": {
      "label": "Coterminal angle",
      "description": "The same direction as θ, from 0° up to 360°.",
      "format": "quantity",
      "unit": "deg"
    },
    "quadrant": {
      "label": "Quadrant",
      "description": "Where θ ends on the unit circle.",
      "format": "text"
    },
    "opposite": {
      "label": "Opposite side",
      "description": "The side across from θ.",
      "format": "number"
    },
    "adjacent": {
      "label": "Adjacent side",
      "description": "The side next to θ.",
      "format": "number"
    },
    "hypotenuse": {
      "label": "Hypotenuse",
      "description": "The side across from the right angle.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "angle",
      "theta": 0.5235987755982988,
      "pair": "oa",
      "opp": 3,
      "adj": 4,
      "hyp": 5
    },
    "outputs": {
      "sin": 0.5,
      "cos": 0.8660254037844386,
      "tan": 0.5773502691896257,
      "csc": 2,
      "sec": 1.1547005383792515,
      "cot": 1.7320508075688772,
      "exact": "sin = 1/2, cos = √3/2, tan = √3/3, csc = 2, sec = 2√3/3, cot = √3",
      "angle": 0.5235987755982988,
      "reference": 0.5235987755982988,
      "coterminal": 0.5235987755982988,
      "quadrant": "Quadrant I"
    },
    "text": "For θ = 30°, sin θ = 0.5 and cos θ = 0.866025."
  },
  "examples": [
    {
      "given": {
        "mode": "angle",
        "theta": 0.5235987755982988
      },
      "expect": {
        "sin": 0.5,
        "cos": 0.8660254037844386,
        "tan": 0.5773502691896257,
        "csc": 2,
        "sec": 1.1547005383792515,
        "cot": 1.7320508075688772,
        "exact": "sin = 1/2, cos = √3/2, tan = √3/3, csc = 2, sec = 2√3/3, cot = √3",
        "quadrant": "Quadrant I"
      },
      "source": "OpenStax Algebra and Trigonometry 2e §7.3 (special angles): sin 30° = 1/2, cos 30° = √3/2; Python 3: math.sqrt(3)/2"
    },
    {
      "given": {
        "mode": "angle",
        "theta": 2.356194490192345
      },
      "expect": {
        "sin": 0.7071067811865476,
        "cos": -0.7071067811865476,
        "tan": -1,
        "exact": "sin = √2/2, cos = -√2/2, tan = -1, csc = √2, sec = -√2, cot = -1",
        "reference": 0.7853981633974483,
        "quadrant": "Quadrant II"
      },
      "source": "hand calculation in content.mdx: 135° is in quadrant II with reference angle 45°; sin +, cos and tan −"
    },
    {
      "given": {
        "mode": "angle",
        "theta": 1.5707963267948966
      },
      "expect": {
        "sin": 1,
        "cos": 0,
        "csc": 1,
        "cot": 0,
        "exact": "sin = 1, cos = 0, tan = undefined, csc = 1, sec = undefined, cot = 0",
        "quadrant": "On the positive y-axis"
      },
      "source": "hand calculation in content.mdx: the unit circle point at 90° is (0, 1), so tan and sec are undefined"
    },
    {
      "given": {
        "mode": "angle",
        "theta": 1
      },
      "expect": {
        "sin": 0.8414709848078965,
        "cos": 0.5403023058681398,
        "tan": 1.557407724654902,
        "cot": 0.6420926159343308,
        "coterminal": 1,
        "quadrant": "Quadrant I"
      },
      "source": "NIST DLMF §4.14; Python 3: math.sin(1), math.cos(1), math.tan(1), 1/math.tan(1)"
    },
    {
      "given": {
        "mode": "angle",
        "theta": -7.3303828583761845
      },
      "expect": {
        "sin": -0.8660254037844386,
        "cos": 0.5,
        "exact": "sin = -√3/2, cos = 1/2, tan = -√3, csc = -2√3/3, sec = 2, cot = -√3/3",
        "coterminal": 5.235987755982989,
        "reference": 1.0471975511965976,
        "quadrant": "Quadrant IV"
      },
      "source": "hand calculation in content.mdx: −420° + 2 × 360° = 300°, quadrant IV, reference angle 60°"
    },
    {
      "given": {
        "mode": "sides",
        "pair": "oa",
        "opp": 3,
        "adj": 4
      },
      "expect": {
        "hypotenuse": 5,
        "sin": 0.6,
        "cos": 0.8,
        "tan": 0.75,
        "angle": 0.6435011087932844,
        "exact": "sin = 3/5, cos = 4/5, tan = 3/4, csc = 5/3, sec = 5/4, cot = 4/3"
      },
      "source": "hand calculation in content.mdx: hypotenuse √(9 + 16) = 5, SOH CAH TOA; Python 3: math.atan2(3, 4)"
    },
    {
      "given": {
        "mode": "sides",
        "pair": "oh",
        "opp": 1,
        "hyp": 2
      },
      "expect": {
        "adjacent": 1.7320508075688772,
        "sin": 0.5,
        "angle": 0.5235987755982989
      },
      "source": "hand calculation in content.mdx: adjacent √(4 − 1) = √3, θ = arcsin(1/2) = 30°; Python 3: math.atan2(1, math.sqrt(3))"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §7.2 Right Triangle Trigonometry (SOH CAH TOA, reciprocal functions) and §7.3 Unit Circle (special angles, reference angles, quadrants). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle",
    "OpenStax, Algebra and Trigonometry 2e, §9.2 Sum and Difference Identities (sin 15° = (√6 − √2)/4, tan 15° = 2 − √3). https://openstax.org/books/algebra-and-trigonometry-2e/pages/9-2-sum-and-difference-identities",
    "NIST Digital Library of Mathematical Functions, §4.14 Definitions and Periodicity (trigonometric functions). https://dlmf.nist.gov/4.14"
  ],
  "related": [
    "triangle",
    "right-triangle",
    "law-of-cosines",
    "arc-length"
  ],
  "changelog": []
}
