ForHosting KIT · Math

Ellipse circumference

Give the two semi-axes of an ellipse and get its circumference from Ramanujan's second formula: semi-axes of 5 and 3 give about 25.53, with a shape value h of 0.0625. Equal semi-axes return the exact circle. 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
A
5
B
3
You get
Circumference
25.5269988628
H
0.0625
Pi
3.1415926536

The exact circumference of an ellipse is an elliptic integral with no elementary closed form, so engineers and students almost always rely on a high-accuracy approximation. Ramanujan's second formula is the classic choice: it uses only the two semi-axes, a handful of arithmetic operations, and a single square root, yet stays extremely close to the true perimeter for ordinary eccentricities. This ellipse circumference Ramanujan 2 calculator accepts two positive finite semi-axes, builds the eccentricity helper h equals the square of (a minus b) over (a plus b), and returns C approximately pi times (a plus b) times one plus three h over ten plus the square root of four minus three h. When a equals b the figure is a circle and the formula collapses exactly to two pi a, so circular checks stay consistent with the circular special case.

What Ramanujan's second approximation computes and why it is used

An ellipse with semi-axes a and b has perimeter given by a complete elliptic integral of the second kind. That integral does not simplify to a finite combination of elementary functions of a and b, so every practical calculator either runs a series or applies a closed approximation. Ramanujan published several remarkably accurate formulas; the second one is especially popular because it needs only one square root and remains excellent for the range of shapes people actually measure—from near-circles to moderately elongated ovals.

Define the dimensionless helper h as the square of the ratio (a minus b) over (a plus b). Then the circumference estimate is pi times (a plus b) times the bracket one plus three h divided by ten plus the square root of four minus three h. When a equals b, h is zero and the bracket is one, so C equals two pi a—the exact circle formula.

As the axes diverge, h grows toward one and the correction term rises smoothly. Relative measurement error on a large axis contributes more absolute perimeter error than the same relative error on a small axis, because the leading factor is the sum a plus b. Units are your responsibility: if a and b are metres the circumference is metres; if they are inches the result is inches.

Order of a and b does not matter—swapping them leaves h and C unchanged—though engineering drawings often label the horizontal semi-axis first. When you need area, eccentricity, or foci as well you may use a fuller ellipse tool; here the search intent is specifically the circumference via Ramanujan's second approximation, which matches homework, CAD checks, and SEO queries for an ellipse circumference Ramanujan 2 calculator.

Where an accurate ellipse circumference helps

Classrooms and tutoring platforms use a dedicated Ramanujan circumference calculator so learners can check the second approximation for arbitrary positive axes without calculator-mode mistakes or confusing major and minor labels. Exam generators and LMS plugins need a deterministic oracle that marks a negative semi-axis as invalid instead of silently taking an absolute value that would hide a student sign error. Failed validation does not consume balance.

Keep both semi-axes finite and positive, pin the rounded circumference in tests, and you get reproducible elliptical perimeters for homework, CAD checks, and edge workers without standing up a special-functions library of your own.

Homework and classroom checks

Students enter two semi-axes and verify Ramanujan II circumference against textbook or worksheet answers without elliptic-integral software.

Exam and LMS auto-grading

Mark ellipse-perimeter items with a deterministic oracle that rejects negative semi-axes and never silently flips a sign error.

How do I calculate ellipse circumference with Ramanujan's second approximation?

Send two finite positive lengths a and b.

What happens if a semi-axis is negative?

A Euclidean ellipse semi-axis cannot be less than zero; those failures are not billed.

What if a equals b?

The ellipse is a circle of radius a (or b).

Is this the exact elliptic integral perimeter?

No. It is Ramanujan's second high-accuracy closed approximation—excellent for ordinary eccentricities without evaluating special functions.

What does the value h tell me?

It measures how unequal the semi-axes are: their difference divided by their sum, squared. It is 0 for a circle and rises toward 1 as the ellipse flattens; semi-axes of 5 and 3 give 0.0625.

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-perimeter-ramanujan2

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-perimeter-ramanujan2 \
  -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_perimeter_ramanujan2",
  "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.

A negative semi-axis is rejected with invalid_input because length cannot be negative in Euclidean geometry.

What Ramanujan's second approximation computes and why it is used

The endpoint never converts units; it only applies the pure geometric map from the two semi-axes to the Ramanujan II circumference.

Input contract, response shape, and negative semi-axis errors

Zero is also rejected so the figure remains a proper ellipse or circle with positive lengths. Example: a equals five and b equals three yields a circumference near twenty-five point five three with a small positive h reflecting the modest eccentricity. Keep requests tiny—two numbers in, a handful of numbers out—and pin the rounded circumference in automated tests so a future change to rounding would surface immediately without re-deriving the elliptic integral by hand. POST a JSON object with two required fields: a and b (aliases semi_axis_a, semi_major, semiAxisA for the first axis and semi_axis_b, semi_minor, semiAxisB for the second). Each value must be a finite positive number or a numeric string; missing, empty, non-numeric, NaN, and Infinity values fail with invalid_input naming the field. On success the body includes the echoed a and b, the computed circumference, the helper h, a formula string restating Ramanujan II, the method tag ramanujan_ii, an is_circle boolean true when a equals b, and the constant pi used by the runtime. Pair the response with your own unit labels in the UI; this endpoint does not emit unit strings or multi-step prose beyond the formula field.

Where an ellipse-circumference Ramanujan II API earns its keep

Fabrication, landscaping, and architecture estimators compute elliptical tracks, table edges, planting-bed borders, and oval openings from measured semi-axes before ordering trim or fencing; calling a tiny parse API avoids embedding ad-hoc pi constants and nested radicals in every spreadsheet.

Fabrication and site estimates

Estimate elliptical track, table edge, bed border, or opening circumference from measured semi-axes via a tiny prepaid API call.

What does the ellipse circumference Ramanujan 2 calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →