{
  "id": "tangent",
  "version": "5e5b88cd405b",
  "status": "published",
  "name": "Tangent Calculator",
  "question": "What is the tangent of my angle?",
  "summary": "Finds tan θ of any angle in degrees or radians, with the exact value at multiples of 15°, cot θ, and the reference angle.",
  "category": "math",
  "subcategory": "trigonometry",
  "url": "https://www.acalculator.org/math/tangent-calculator",
  "markdown": "https://www.acalculator.org/math/tangent-calculator.md",
  "kind": "function",
  "method": "tan θ = sin θ ÷ cos θ, the slope of the line from the origin at angle θ. At a multiple of 15° the exact value comes from the special angles and the quadrant sign; otherwise tan θ is computed in 64-bit floating point. cot θ = 1 ÷ tan θ.",
  "assumptions": [
    "The angle can be typed in degrees or radians, from −1,000,000 to 1,000,000 radians, and can be negative or more than 360°.",
    "An angle within one part in 10¹² of a multiple of 15° counts as that multiple, so tan 180° is exactly 0 and tan 90° is undefined.",
    "tan θ has no answer at 90° + k × 180° (cos θ = 0). cot θ shows nothing where tan θ = 0 (0°, 180°, …)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "angle": {
        "title": "Angle θ",
        "description": "Any angle, in degrees or radians; a negative angle turns clockwise.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "minimum": -1000000,
        "maximum": 1000000
      }
    }
  },
  "outputs": {
    "tan": {
      "label": "tan θ",
      "description": "Tangent of θ: sin θ ÷ cos θ, the slope of the line at angle θ.",
      "format": "number"
    },
    "exact": {
      "label": "Exact value",
      "description": "The value as a fraction and square roots, for angles that are a multiple of 15°.",
      "format": "text"
    },
    "cot": {
      "label": "cot θ",
      "description": "1 ÷ tan θ; empty where tan θ = 0.",
      "format": "number"
    },
    "reference": {
      "label": "Reference angle",
      "description": "The acute angle between θ and the x-axis, from 0° to 90°.",
      "format": "quantity",
      "unit": "deg"
    },
    "quadrant": {
      "label": "Quadrant",
      "description": "Where θ ends on the unit circle.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "angle": 0.5235987755982988
    },
    "outputs": {
      "tan": 0.5773502691896257,
      "exact": "tan 30° = √3/3",
      "cot": 1.7320508075688772,
      "reference": 0.5235987755982988,
      "quadrant": "Quadrant I"
    },
    "text": "tan(30°) = 0.57735."
  },
  "examples": [
    {
      "given": {
        "angle": 0.5235987755982988
      },
      "expect": {
        "tan": 0.5773502691896257,
        "exact": "tan 30° = √3/3",
        "cot": 1.7320508075688772,
        "quadrant": "Quadrant I"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §7.4 The Other Trigonometric Functions (tan θ = sin θ ÷ cos θ; tan π/6 = √3/3). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-4-the-other-trigonometric-functions"
    },
    {
      "given": {
        "angle": 0.7853981633974483
      },
      "expect": {
        "tan": 1,
        "exact": "tan 45° = 1",
        "cot": 1
      },
      "source": "hand calculation in content.mdx: tan 45° = (√2/2) ÷ (√2/2) = 1; OpenStax, Algebra and Trigonometry 2e, §7.4 The Other Trigonometric Functions (tan θ = sin θ ÷ cos θ; tan π/6 = √3/3). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-4-the-other-trigonometric-functions"
    },
    {
      "given": {
        "angle": 2.0943951023931953
      },
      "expect": {
        "tan": -1.7320508075688772,
        "exact": "tan 120° = -√3",
        "quadrant": "Quadrant II",
        "reference": 1.0471975511965976
      },
      "source": "hand calculation in content.mdx: 120° is in quadrant II, reference angle 60°, tangent negative; OpenStax, Algebra and Trigonometry 2e, §7.4 The Other Trigonometric Functions (tan θ = sin θ ÷ cos θ; tan π/6 = √3/3). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-4-the-other-trigonometric-functions"
    },
    {
      "given": {
        "angle": 1
      },
      "expect": {
        "tan": 1.557407724654902,
        "cot": 0.6420926159343308
      },
      "source": "NIST DLMF §4.14 (tangent of a real angle), https://dlmf.nist.gov/4.14; Python 3: math.tan(1), 1/math.tan(1)"
    },
    {
      "given": {
        "angle": 3.490658503988659
      },
      "expect": {
        "tan": 0.3639702342662023,
        "quadrant": "Quadrant III"
      },
      "source": "NIST DLMF §4.14, https://dlmf.nist.gov/4.14; Python 3: math.tan(math.radians(200))"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §7.4 The Other Trigonometric Functions (tan t = sin t ÷ cos t; cot t = cos t ÷ sin t; tan π/6 = √3/3). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-4-the-other-trigonometric-functions (retrieved 2026-10-01)",
    "OpenStax, Algebra and Trigonometry 2e, §7.3 Unit Circle (special angles). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle (retrieved 2026-10-01)",
    "NIST Digital Library of Mathematical Functions, §4.14 Definitions and Periodicity (trigonometric functions). https://dlmf.nist.gov/4.14 (retrieved 2026-10-01)"
  ],
  "related": [
    "sine",
    "cosine",
    "inverse-tangent",
    "tangent-line"
  ],
  "changelog": []
}
