{
  "id": "chord",
  "version": "259aca941b09",
  "status": "published",
  "name": "Chord Calculator",
  "question": "How long is the chord of the circle?",
  "summary": "Finds the length of a chord of a circle, c = 2r sin(θ/2), from the radius and the central angle, the distance from the centre, or the arc height, with the arc length and the segment area.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/chord-calculator",
  "markdown": "https://www.acalculator.org/math/chord-calculator.md",
  "kind": "function",
  "method": "c = 2r sin(θ/2); θ = 2 arccos(d/r) or 2 arcsin(c/2r); from chord and height, r = c²/(8h) + h/2 and θ = 2 atan2(c/2, r − h); d = r cos(θ/2), h = r − d, s = rθ, segment area r²(θ − sin θ)/2.",
  "assumptions": [
    "Lengths are plain numbers in any one unit; every length output is in that unit and the area in its square.",
    "From the radius and the chord, the angle is the one at most 180° (the minor arc).",
    "From the chord and height, a height above the radius means the arc is the major arc (more than 180°).",
    "The maths runs in double precision."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "know": {
        "title": "I know",
        "description": "Which two measures of the circle you know.",
        "type": "string",
        "enum": [
          "angle",
          "distance",
          "chord",
          "height"
        ]
      },
      "r": {
        "title": "Radius",
        "description": "The radius r of the circle.",
        "type": "number",
        "minimum": 1e-50,
        "maximum": 1e+50
      },
      "angle": {
        "title": "Central angle",
        "description": "The angle θ at the centre between the two radii to the ends of the chord, more than 0° and below 360°.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "exclusiveMinimum": 0,
        "exclusiveMaximum": 6.283185307179586
      },
      "d": {
        "title": "Distance from the centre",
        "description": "The distance d from the centre of the circle to the middle of the chord, from 0 up to the radius.",
        "type": "number",
        "minimum": 0,
        "maximum": 1e+50
      },
      "c": {
        "title": "Chord length",
        "description": "The straight-line length c between the two ends of the chord.",
        "type": "number",
        "minimum": 1e-50,
        "maximum": 1e+50
      },
      "h": {
        "title": "Height of the arc",
        "description": "The sagitta h: the distance from the middle of the chord to the arc, on the side of the arc you mean.",
        "type": "number",
        "minimum": 1e-50,
        "maximum": 1e+50
      }
    }
  },
  "outputs": {
    "chord": {
      "label": "Chord length",
      "description": "c = 2r sin(θ/2), in the unit of the lengths typed.",
      "format": "number"
    },
    "radius": {
      "label": "Radius",
      "description": "The radius r, typed or found from the chord and height: r = c²/(8h) + h/2.",
      "format": "number"
    },
    "degrees": {
      "label": "Central angle (°)",
      "description": "The central angle θ in degrees.",
      "format": "number"
    },
    "radians": {
      "label": "Central angle (rad)",
      "description": "The central angle θ in radians.",
      "format": "number"
    },
    "distance": {
      "label": "Distance from the centre",
      "description": "d = r cos(θ/2): from the centre to the middle of the chord; negative when the arc is the major arc.",
      "format": "number"
    },
    "height": {
      "label": "Height of the arc (sagitta)",
      "description": "h = r − d = 2r sin²(θ/4): from the middle of the chord to the arc.",
      "format": "number"
    },
    "arc": {
      "label": "Arc length",
      "description": "s = rθ: the length of the arc that the chord cuts off.",
      "format": "number"
    },
    "segment": {
      "label": "Segment area",
      "description": "A = r²(θ − sin θ)/2: the area between the chord and the arc, in square units.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "know": "angle",
      "r": 10,
      "angle": "60 deg",
      "d": 6,
      "c": 12,
      "h": 2
    },
    "outputs": {
      "chord": 9.999999999999998,
      "radius": 10,
      "degrees": 59.99999999999999,
      "radians": 1.0471975511965976,
      "distance": 8.660254037844387,
      "height": 1.3397459621556134,
      "arc": 10.471975511965976,
      "segment": 9.058607370607952
    },
    "text": "The chord is 10 long."
  },
  "examples": [
    {
      "given": {
        "know": "angle",
        "r": 10,
        "angle": 1.0471975511965976
      },
      "expect": {
        "chord": 10,
        "distance": 8.660254037844387,
        "height": 1.3397459621556136,
        "arc": 10.471975511965976,
        "segment": 9.058607370607952
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §10.2 Non-right Triangles: Law of Cosines (a² = b² + c² − 2bc cos α), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-2-non-right-triangles-law-of-cosines (retrieved 2026-10-02); OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (arc length s = rθ, sector area ½θr²), https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (retrieved 2026-10-02); hand calculation in content.mdx: c = 2 × 10 × sin 30° = 10",
      "tolerance": 1e-12
    },
    {
      "given": {
        "know": "distance",
        "r": 5,
        "d": 3
      },
      "expect": {
        "chord": 8,
        "degrees": 106.26020470831197,
        "height": 2
      },
      "source": "hand calculation in content.mdx: c = 2√(5² − 3²) = 8 (Pythagorean theorem); OpenStax, Algebra and Trigonometry 2e, §10.2 Non-right Triangles: Law of Cosines (a² = b² + c² − 2bc cos α), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-2-non-right-triangles-law-of-cosines (retrieved 2026-10-02)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "know": "height",
        "c": 12,
        "h": 2
      },
      "expect": {
        "radius": 10,
        "degrees": 73.73979529168804,
        "distance": 8
      },
      "source": "hand calculation in content.mdx: r = 12²/(8 × 2) + 2/2 = 9 + 1 = 10; OpenStax, Algebra and Trigonometry 2e, §10.2 Non-right Triangles: Law of Cosines (a² = b² + c² − 2bc cos α), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-2-non-right-triangles-law-of-cosines (retrieved 2026-10-02)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "know": "chord",
        "r": 1,
        "c": 2
      },
      "expect": {
        "degrees": 180,
        "height": 1,
        "arc": 3.141592653589793
      },
      "source": "a chord through the centre is a diameter: θ = 180°, h = r, s = πr; OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (arc length s = rθ, sector area ½θr²), https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (retrieved 2026-10-02)",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §10.2 Non-right Triangles: Law of Cosines (a² = b² + c² − 2bc cos α), CC BY 4.0. https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-2-non-right-triangles-law-of-cosines (retrieved 2026-10-02)",
    "OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (arc length s = rθ; sector area ½θr²), CC BY 4.0. https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (retrieved 2026-10-02)"
  ],
  "related": [
    "arc-length",
    "circle",
    "law-of-cosines",
    "circumference"
  ],
  "changelog": []
}
