{
  "id": "cosine",
  "version": "83c9f8d4b79a",
  "status": "published",
  "name": "Cosine Calculator",
  "question": "What is the cos of my angle?",
  "summary": "Finds cos θ of any angle in degrees or radians, with the exact value at multiples of 15°, sec θ, and the reference angle.",
  "category": "math",
  "subcategory": "trigonometry",
  "url": "https://www.acalculator.org/math/cosine-calculator",
  "markdown": "https://www.acalculator.org/math/cosine-calculator.md",
  "kind": "function",
  "method": "cos θ is the x value of the point at angle θ on the unit circle. At a multiple of 15° the exact value comes from the special angles and the quadrant sign; otherwise cos θ is computed in 64-bit floating point. sec θ = 1 ÷ cos θ.",
  "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 cos 90° is exactly 0.",
    "sec θ shows nothing where cos θ = 0 (90°, 270°, …)."
  ],
  "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": {
    "cos": {
      "label": "cos θ",
      "description": "Cosine of θ: the x value of the point at angle θ on the unit circle.",
      "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"
    },
    "sec": {
      "label": "sec θ",
      "description": "1 ÷ cos θ; empty where cos θ = 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": {
      "cos": 0.8660254037844386,
      "exact": "cos 30° = √3/2",
      "sec": 1.1547005383792515,
      "reference": 0.5235987755982988,
      "quadrant": "Quadrant I"
    },
    "text": "cos(30°) = 0.866025."
  },
  "examples": [
    {
      "given": {
        "angle": 1.0471975511965976
      },
      "expect": {
        "cos": 0.5,
        "exact": "cos 60° = 1/2",
        "sec": 2,
        "reference": 1.0471975511965976,
        "quadrant": "Quadrant I"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §7.3 Unit Circle (special angles: cos 60° = 1/2, cos 30° = √3/2). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle"
    },
    {
      "given": {
        "angle": 2.6179938779914944
      },
      "expect": {
        "cos": -0.8660254037844386,
        "exact": "cos 150° = -√3/2",
        "quadrant": "Quadrant II",
        "reference": 0.5235987755982988
      },
      "source": "hand calculation in content.mdx: 150° is in quadrant II, reference angle 30°, cosine negative; OpenStax, Algebra and Trigonometry 2e, §7.3 Unit Circle (special angles: cos 60° = 1/2, cos 30° = √3/2). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle"
    },
    {
      "given": {
        "angle": 1.5707963267948966
      },
      "expect": {
        "cos": 0,
        "exact": "cos 90° = 0",
        "quadrant": "On the positive y-axis"
      },
      "source": "hand calculation in content.mdx: the unit circle point at 90° is (0, 1), so sec is undefined; OpenStax, Algebra and Trigonometry 2e, §7.3 Unit Circle (special angles: cos 60° = 1/2, cos 30° = √3/2). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle"
    },
    {
      "given": {
        "angle": 1
      },
      "expect": {
        "cos": 0.5403023058681398,
        "sec": 1.8508157176809255
      },
      "source": "NIST DLMF §4.14 (cosine of a real angle), https://dlmf.nist.gov/4.14; Python 3: math.cos(1), 1/math.cos(1)"
    },
    {
      "given": {
        "angle": 3.490658503988659
      },
      "expect": {
        "cos": -0.9396926207859084,
        "quadrant": "Quadrant III"
      },
      "source": "NIST DLMF §4.14, https://dlmf.nist.gov/4.14; Python 3: math.cos(math.radians(200))"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §7.3 Unit Circle (cosine as the x value on the unit circle; special angles). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-3-unit-circle (retrieved 2026-10-01)",
    "OpenStax, Algebra and Trigonometry 2e, §7.4 The Other Trigonometric Functions (sec θ = 1 ÷ cos θ). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-4-the-other-trigonometric-functions (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",
    "tangent",
    "inverse-cosine",
    "law-of-cosines"
  ],
  "changelog": []
}
