ForHosting KIT · Math

Ellipse calculator

Enter the two semi-axes of an ellipse and get every key measure at once: semi-axes of 5 and 3 give an area of about 47.12, a perimeter of about 25.5269988628, an eccentricity of 0.8 and foci 4 from the centre. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
First semi-axis length
5
Second semi-axis length
3
You get
Semi major
5
Semi minor
3
Area
47.1238898038
Perimeter
25.5269988628

This calculator turns two positive semi-axes into the classic ellipse metrics you need for homework, design, and code: the exact area π times a times b, a high-accuracy approximate perimeter from Ramanujan’s second formula, the eccentricity that measures how far the shape is from a circle, and the focal distance from the center to each focus.

What an ellipse calculator returns and why semi-axes matter

An ellipse is the set of points whose summed distances to two fixed foci is constant. In the axis-aligned standard form the half-widths along the two principal directions are the semi-axes a and b: when a equals b the figure is a circle, and when they differ the shape stretches.

This tool exists to turn those two lengths into a single deterministic response without forcing you to look up which formula uses the major axis, how to approximate the incomplete elliptic integral for the circumference, or how eccentricity relates to the linear distance to the foci.

If you need chord length on a circle, a triangle solver, or circle construction from three points, use a tool dedicated to those problems; the search intent here is the ellipse metrics from two semi-axes and a clear answer or an honest error when the axes are not positive.

How the closed forms are evaluated: area, Ramanujan, eccentricity, foci

Area is the exact product π times a times b, independent of which axis is longer. The circumference of a general ellipse has no elementary closed form, so the tool applies Ramanujan’s second approximation: first form h as the square of a minus b over a plus b, then multiply π times a plus b by one plus three h over ten plus the square root of four minus three h.

That expression is symmetric in a and b, extremely accurate for moderate eccentricity, and reduces cleanly toward the circle circumference two π r when a equals b. The distance between the two foci is reported as two c. Optional precision only rounds the published fields; the internal solve always uses full double precision before that final rounding step.

Homework and exam preparation

Compute ellipse area, approximate perimeter, eccentricity, and focal distance from textbook semi-axes, and verify that non-positive axes are rejected.

Design, tracks, and simulation

Size elliptical openings, oval track perimeters, gasket outlines, or orbital sketches from known half-widths in CAD and game tools.

What does the ellipse calculator cost?

It is free in your browser on this page.

Which Ramanujan formula is used for the perimeter?

Ramanujan’s second approximation: π(a+b)[1 + 3h/(10+√(4−3h))] with h=((a−b)/(a+b))².

Does the order of a and b matter?

Area and perimeter are symmetric. Eccentricity and focal distance use max(a,b) as the semi-major axis, so swapping a and b does not change those results.

What does an eccentricity of 0.8 mean?

Eccentricity measures how far the shape is from a circle: 0 is a perfect circle and larger values mean a more stretched oval. Semi-axes of 5 and 3 give 0.8, a clearly elongated ellipse.

Why is the ellipse perimeter only approximate?

Because no simple exact formula exists for the circumference of a general ellipse. Ramanujan's second formula comes extremely close for moderate stretching and gives exactly 2πr when both semi-axes are equal.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geom/ellipse

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geom/ellipse \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":5,"b":3}'
{
  "a": 5,
  "b": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.ellipse",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

You enter a and b as finite positive lengths; the engine normalizes which axis is major and which is minor so swapping the values never changes eccentricity or the focus placement, then returns semi_major, semi_minor, area, perimeter, eccentricity, focal_distance, and the full distance between the two foci. When a or b is missing, zero, negative, or non-finite, the tool returns invalid_input instead of a silent NaN or a complex length. Through the API a successful request costs $0.002; validation failures are not charged.

What an ellipse calculator returns and why semi-axes matter

The response always echoes a and b, reports semi_major as the larger axis and semi_minor as the smaller, and includes area, perimeter with perimeter_method set to ramanujan_ii, eccentricity, focal_distance from center to each focus, foci_distance as twice that value, an is_circle flag, and formula strings for area, perimeter, eccentricity, and focal distance so a student or a log line can verify the identity without reading the source. Missing a or b, non-finite values, or a non-positive axis all raise invalid_input with a message that names the failing field. That discipline keeps automated tests stable, makes caching safe, and prevents a script from treating a degenerate segment as a real ellipse.

How the closed forms are evaluated: area, Ramanujan, eccentricity, foci

The engine resolves a from the field a with aliases semi_axis_a, semiAxisA, and A, and b from b with aliases semi_axis_b, semiAxisB, and B, requiring each to be finite and strictly greater than zero. For eccentricity and focus placement the engine sets semi_major to the maximum of a and b and semi_minor to the minimum, then computes e as the square root of one minus the square of the minor-to-major ratio, and the focal distance c as the square root of major squared minus minor squared. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing Ramanujan or the major-minor normalization yourself.

Where ellipse metrics fit in study, design, and code

Students meet the ellipse when a textbook asks for area from semi-axes, when an exam demands eccentricity given a and b, or when analytic geometry homework wants the distance from the center to a focus before writing the reflection property or the standard equation. Teachers can pre-generate answer keys that list area and Ramanujan perimeter for integer axes, and that refuse zero or negative lengths instead of printing NaN. Mechanical and civil design often needs the floor area of an elliptical opening, the approximate perimeter of an oval track or gasket, or the focal separation for an elliptical mirror layout; knowing that a requested axis is not positive is as valuable as the number itself. Surveying and CAD workflows place elliptical arcs as construction geometry, and game or simulation teams use area and eccentricity for collision ellipses, camera vignettes, and orbital sketches that should stay deterministic across platforms. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with other free geometry endpoints when you need circle construction, chord length, or triangle solvers for a lab of deterministic tools, and with documentation that shows both axes and the finished metrics so the numbers and the picture stay aligned for learners and reviewers. Whether you arrived searching for an ellipse calculator or for Ramanujan perimeter from semi-axes, the contract is the same: positive a and b in, finite metrics or a clear invalid_input out.

Deterministic geometry fixtures

Generate reproducible ellipse metrics for unit tests, contest validators, and CI assertions without hand-rolled Ramanujan or major-minor logic.

What if a or b is zero or negative?

The handler returns invalid_input with a message that the semi-axis must be a positive finite number.

Can I control rounding?

Yes. Set precision (aliases decimals, dp) to an integer from 0 to 15; the default is 10 decimal places on all numeric fields.

Read the full KIT documentation →