ForHosting KIT · Math

Ellipse directrix calculator

Enter the two semi-axes of an ellipse and get the distance from the centre to each directrix line: semi-axes of 5 and 3 give a focus at 4, an eccentricity of 0.8 and directrices 6.25 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
A
5
B
3
You get
Semi major
5
Semi minor
3
Linear eccentricity
4
Eccentricity
0.8

Every non-circular ellipse is defined by a focus–directrix property: the ratio of distance to a focus over distance to the matching directrix equals the eccentricity e, a number strictly between zero and one. Textbooks ask for the location of those directrices once the semi-axes are known, and design or astronomy pipelines often need the same scalar—the distance from the center to each directrix line—without re-deriving square roots by hand. This ellipse directrix calculator accepts the two positive semi-axis lengths a and b, takes the larger as the semi-major axis and the smaller as the semi-minor axis, and returns the directrix distance together with linear eccentricity and eccentricity. A circle (a equals b) is rejected as a degenerate case with no finite directrix.

What the directrix of an ellipse is and why distance matters

An ellipse is the set of points in a plane for which the sum of distances to two fixed foci is constant. An equivalent definition uses a focus and a directrix: for every point P on the ellipse, the distance from P to a focus divided by the distance from P to the corresponding directrix equals the eccentricity e.

That eccentricity is dimensionless and satisfies zero less than e less than one for a non-circular ellipse; the limiting case e equals zero is a circle, which has no finite directrix because the formal ratio would require division by zero. Once the semi-major axis A and semi-minor axis B are known, the linear eccentricity c—the distance from the geometric center to each focus—is the square root of A squared minus B squared. Eccentricity itself is c divided by A.

The two directrices are lines perpendicular to the major axis, and the distance from the center to either directrix is A divided by e, which algebraically simplifies to A squared over c. That single positive length is what most homework problems, CAD annotations, and catalog rows need: place the directrices at plus or minus that distance from the center along the major-axis direction.

Computing it by hand is short algebra, but students routinely swap the ellipse formula with the hyperbola one, use the wrong axis as major, or forget that equal semi-axes make e zero. Automating the calculation with validated positive inputs and an explicit reject for the circular degenerate case removes those slips while still exposing every intermediate quantity for the next step of a solution or pipeline.

Classroom and homework checks

Let students submit semi-axes a and b and verify the center-to-directrix distance, eccentricity, and linear eccentricity against textbook methods.

Exam and LMS auto-grading

Mark ellipse directrix items with a deterministic oracle that rejects circles (a = b) as degenerate and never invents a finite distance when e is zero.

CAD and technical documentation

Annotate elliptical profiles with focus and directrix distances from measured semi-axes without importing a full computer-algebra library.

How do I find the directrix distance of an ellipse?

Send positive finite numbers a and b (unequal).

What happens if a equals b?

A circle is a degenerate ellipse with eccentricity 0 and has no finite directrix.

What is the directrix of an ellipse?

It is a straight line perpendicular to the major axis. For every point on the ellipse, the distance to a focus divided by the distance to the matching directrix equals the eccentricity, a number between 0 and 1.

Does it matter which semi-axis I enter first?

No. The larger of the two values is always taken as the semi-major axis and the smaller as the semi-minor, so you do not have to order them yourself.

What mistakes are common with ellipse directrices?

Using the hyperbola formula by accident, treating the shorter axis as the major one, or forgetting that equal semi-axes make a circle, which has no finite directrix.

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-directrix

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-directrix \
  -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_directrix",
  "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.

Input contract, formulas, and how the response is shaped

Both must be finite and strictly positive; zero and negative lengths fail because a semi-axis is a geometric length, not a signed coordinate. The engine sets semi-major A to the maximum of a and b and semi-minor B to the minimum, so you do not need to order the axes yourself. POST a JSON body with two required numeric fields: a and b, the semi-axis lengths of the ellipse. Numbers may arrive as JSON numbers or plain numeric strings. If a equals b the ellipse is a circle: eccentricity would be zero and the directrix distance undefined, so the task fails with invalid_input and a message that names the degenerate circle case. Otherwise it computes linear eccentricity c as the square root of A squared minus B squared, eccentricity e as c over A, and directrix_distance as A over e, equivalently A squared over c. The success payload echoes a and b, reports semi_major and semi_minor, then linear_eccentricity, eccentricity, directrix_distance, and a short formula string you can show next to the answer. Missing fields, non-numeric values, non-positive axes, and the circular case all fail with invalid_input and are never billed. There is no randomness, no clock dependency, and no network call; two identical requests always produce the same JSON. Pair the response with your own plotting code if you need the actual line equations x equals plus or minus the distance in major-axis coordinates; this endpoint returns the scalar distance and the supporting conic invariants only.

Where an ellipse directrix API earns its keep and what it costs

Classrooms and tutoring platforms use an ellipse directrix calculator so learners can check the center-to-directrix distance for arbitrary semi-axes without flipping major and minor by hand. Exam generators and LMS plugins need a deterministic oracle that rejects a equals b as degenerate instead of silently returning infinity or NaN that a buggy grader might treat as success. Failed validation does not consume balance. Engineering notebooks and CAD helpers often annotate focus–directrix geometry when documenting elliptical arches, cam profiles, or optical cross-sections; calling a tiny parse API avoids pulling a full computer-algebra system for two positive numbers. Keep a and b positive and unequal, pin the rounded directrix_distance in tests, and you get reproducible conic geometry for homework, gradebooks, and edge workers without standing up symbolic math infrastructure of your own.

Do I need to pass the semi-major axis first?

No. The calculator sets semi_major = max(a,b) and semi_minor = min(a,b), so either order of the two positive lengths is accepted.

What other values does the response include?

Besides directrix_distance it returns semi_major, semi_minor, linear_eccentricity c, eccentricity e, the echoed inputs, and a short formula string.

What does the ellipse directrix 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 →