{
  "id": "ellipse",
  "version": "59bd8589f30e",
  "status": "published",
  "name": "Ellipse Calculator",
  "question": "What are the ellipse’s area and foci?",
  "summary": "Finds an ellipse’s area, perimeter (circumference), foci, vertices, eccentricity and standard-form equation from its two semi-axes and its center.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/ellipse-calculator",
  "markdown": "https://www.acalculator.org/math/ellipse-calculator.md",
  "kind": "function",
  "method": "(x − h)²/a² + (y − k)²/b² = 1; c² = |a² − b²|; e = c ÷ max(a, b); area πab; perimeter 4·max(a, b)·E(e), computed by the arithmetic-geometric mean.",
  "assumptions": [
    "a is the semi-axis along x and b along y, so the longer one is the major axis.",
    "The ellipse’s axes are parallel to the x and y axes.",
    "The perimeter has no closed form; the arithmetic-geometric mean gives it to double precision."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "Semi-axis along x (a)",
        "description": "Half the width of the ellipse: the distance from the center to its edge along x.",
        "type": "number",
        "minimum": 1e-12,
        "maximum": 1000000000000
      },
      "b": {
        "title": "Semi-axis along y (b)",
        "description": "Half the height of the ellipse: the distance from the center to its edge along y.",
        "type": "number",
        "minimum": 1e-12,
        "maximum": 1000000000000
      },
      "h": {
        "title": "Center x (h)",
        "description": "The x coordinate of the center; 0 when left empty.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "k": {
        "title": "Center y (k)",
        "description": "The y coordinate of the center; 0 when left empty.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      }
    }
  },
  "outputs": {
    "area": {
      "label": "Area",
      "description": "The space inside the ellipse, πab.",
      "format": "number"
    },
    "perimeter": {
      "label": "Perimeter (circumference)",
      "description": "The distance around the ellipse, exact to double precision.",
      "format": "number"
    },
    "equation": {
      "label": "Equation",
      "description": "The standard form of the ellipse.",
      "format": "text"
    },
    "foci": {
      "label": "Foci",
      "description": "The two focus points on the longer axis.",
      "format": "text"
    },
    "vertices": {
      "label": "Vertices",
      "description": "The two ends of the longer (major) axis.",
      "format": "text"
    },
    "c": {
      "label": "Focal distance c",
      "description": "The distance from the center to each focus, √|a² − b²|.",
      "format": "number"
    },
    "e": {
      "label": "Eccentricity",
      "description": "c divided by the longer semi-axis: 0 for a circle, near 1 for a long thin ellipse.",
      "format": "number"
    },
    "major": {
      "label": "Major axis length",
      "description": "The longer axis, twice the longer semi-axis.",
      "format": "number"
    },
    "minor": {
      "label": "Minor axis length",
      "description": "The shorter axis, twice the shorter semi-axis.",
      "format": "number"
    },
    "latus": {
      "label": "Latus rectum",
      "description": "The chord through a focus at a right angle to the major axis: 2 × minor² ÷ major semi-axis.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": 3,
      "b": 5,
      "h": 0,
      "k": 0
    },
    "outputs": {
      "area": 47.12388980384689,
      "perimeter": 25.526998863398127,
      "equation": "x²/9 + y²/25 = 1",
      "foci": "(0, −4), (0, 4)",
      "vertices": "(0, −5), (0, 5)",
      "c": 4,
      "e": 0.8,
      "major": 10,
      "minor": 6,
      "latus": 3.6
    },
    "text": "An ellipse with semi-axes 3 and 5 has an area of 47.1238898 and a perimeter of 25.52699886."
  },
  "examples": [
    {
      "given": {
        "a": 3,
        "b": 5,
        "h": -2,
        "k": -3
      },
      "expect": {
        "equation": "(x + 2)²/9 + (y + 3)²/25 = 1",
        "foci": "(−2, −7), (−2, 1)",
        "vertices": "(−2, −8), (−2, 2)",
        "c": 4,
        "e": 0.8,
        "area": 47.12388980384689,
        "perimeter": 25.526998863398127
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §12.1 The Ellipse (standard form, c² = a² − b², vertices and foci; vertices (−2, −8) and (−2, 2) with foci (−2, −7) and (−2, 1) give (x + 2)²/9 + (y + 3)²/25 = 1; area πab), https://openstax.org/books/algebra-and-trigonometry-2e/pages/12-1-the-ellipse (retrieved 2026-10-05); perimeter: hand calculation in content.mdx by the AGM, NIST Digital Library of Mathematical Functions, §19.8 (AGM: 19.8.1, 19.8.2, 19.8.6) and §19.9 (perimeter L(a, b) = 4aE(k), 19.9.9), https://dlmf.nist.gov/19.8 and https://dlmf.nist.gov/19.9 (retrieved 2026-10-05)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "a": 2,
        "b": 2
      },
      "expect": {
        "e": 0,
        "c": 0,
        "perimeter": 12.566370614359172,
        "area": 12.566370614359172,
        "foci": "(0, 0), (0, 0)"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §12.1 The Ellipse (standard form, c² = a² − b², vertices and foci; vertices (−2, −8) and (−2, 2) with foci (−2, −7) and (−2, 1) give (x + 2)²/9 + (y + 3)²/25 = 1; area πab), https://openstax.org/books/algebra-and-trigonometry-2e/pages/12-1-the-ellipse (retrieved 2026-10-05); NIST Digital Library of Mathematical Functions, §19.8 (AGM: 19.8.1, 19.8.2, 19.8.6) and §19.9 (perimeter L(a, b) = 4aE(k), 19.9.9), https://dlmf.nist.gov/19.8 and https://dlmf.nist.gov/19.9 (retrieved 2026-10-05)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "a": 10,
        "b": 6
      },
      "expect": {
        "c": 8,
        "e": 0.8,
        "latus": 7.2,
        "area": 188.49555921538757,
        "perimeter": 51.053997726796254,
        "foci": "(−8, 0), (8, 0)"
      },
      "source": "hand calculation in content.mdx: c = √(100 − 36) = 8, latus rectum 2 × 36 ÷ 10 = 7.2; OpenStax, Algebra and Trigonometry 2e, §12.1 The Ellipse (standard form, c² = a² − b², vertices and foci; vertices (−2, −8) and (−2, 2) with foci (−2, −7) and (−2, 1) give (x + 2)²/9 + (y + 3)²/25 = 1; area πab), https://openstax.org/books/algebra-and-trigonometry-2e/pages/12-1-the-ellipse (retrieved 2026-10-05); NIST Digital Library of Mathematical Functions, §19.8 (AGM: 19.8.1, 19.8.2, 19.8.6) and §19.9 (perimeter L(a, b) = 4aE(k), 19.9.9), https://dlmf.nist.gov/19.8 and https://dlmf.nist.gov/19.9 (retrieved 2026-10-05)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "a": 99,
        "b": 1
      },
      "expect": {
        "perimeter": 396.110739426876
      },
      "source": "hand calculation in content.mdx by the AGM, checked by numerical integration of 4a∫√(1 − e²sin²θ)dθ; NIST Digital Library of Mathematical Functions, §19.8 (AGM: 19.8.1, 19.8.2, 19.8.6) and §19.9 (perimeter L(a, b) = 4aE(k), 19.9.9), https://dlmf.nist.gov/19.8 and https://dlmf.nist.gov/19.9 (retrieved 2026-10-05)",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §12.1 The Ellipse (standard form, c² = a² − b², vertices and foci, and area πab), CC BY 4.0. https://openstax.org/books/algebra-and-trigonometry-2e/pages/12-1-the-ellipse (retrieved 2026-10-05)",
    "NIST Digital Library of Mathematical Functions, §19.8 Quadratic Transformations (the arithmetic-geometric mean, 19.8.1 and 19.8.2, and E(k) by it, 19.8.6). https://dlmf.nist.gov/19.8 (retrieved 2026-10-05)",
    "NIST Digital Library of Mathematical Functions, §19.9 Inequalities (the perimeter L(a, b) = 4aE(k), k² = 1 − b²/a², 19.9.9). https://dlmf.nist.gov/19.9 (retrieved 2026-10-05)"
  ],
  "related": [
    "circle",
    "area",
    "parabola",
    "perimeter"
  ],
  "changelog": []
}
