Ellipse foci calculator
Enter the semi-major and semi-minor axes of an ellipse and get its two foci: axes of 5 and 3 put them at (4, 0) and (−4, 0), 8 apart, with an eccentricity of 0.8. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 5
- B
- 3
- C
- 4
- Focal distance
- 4
- Foci distance
- 8
- Eccentricity
- 0.8
Every ellipse has two special points called foci that define the classic string-construction property: the sum of the distances from any point on the curve to the two foci is constant. Architects sketching elliptical arches, teachers grading conic-section homework, and CAD scripts that place reflectors or planetary orbits all need those foci as coordinates and as a linear distance from the center. This ellipse foci calculator takes the semi-major axis a and the semi-minor axis b, applies the closed form c equals the square root of a squared minus b squared, and returns the focal distance, the ordered foci for the standard horizontal form centered at the origin, the interfocal distance two c, and the eccentricity c over a.
What ellipse foci mean and how c is derived from the semi-axes
An ellipse is the locus of points for which the sum of the distances to two fixed foci is constant and equal to twice the semi-major axis. In the standard Cartesian form x squared over a squared plus y squared over b squared equals one, with a greater than or equal to b and both positive, the major axis lies along x and the center is the origin.
The linear eccentricity, often written c, is the distance from the center to either focus, and elementary algebra shows that c equals the square root of a squared minus b squared. The two foci therefore sit at positive c and zero, and negative c and zero. The dimensionless eccentricity e equals c over a and ranges from zero for a circle, when a equals b and both foci collapse to the origin, up toward one as the ellipse flattens and the foci move toward the vertices.
The interfocal distance is simply two c and is useful when a design brief lists focus-to-focus separation instead of the center-to-focus length. If you send b greater than a, validation fails so that a caller who meant vertical major must restate the axes rather than receive horizontal foci under swapped labels.
Where an ellipse foci calculator earns its keep
Geometry homework and entrance exams often ask for the coordinates of the foci given only the two semi-axes, sometimes after students have already computed a and b from a major-axis length and a minor-axis length. Learners sometimes forget that c uses a squared minus b squared rather than a minus b, or they place foci on the minor axis by mistake; a deterministic oracle that always applies the standard horizontal form catches those errors before a tutor spends a session on the string property.
Planetary and orbital notebooks that treat a nearly circular path as an ellipse need linear eccentricity and e for semi-major and semi-minor inputs already held in a spreadsheet. Exam-prep generators and LMS auto-graders need a tiny closed-form checker that rejects minor greater than major as invalid rather than silently swapping axes and accepting a wrong orientation as correct.
What you can do with it
Classroom and homework checks
Students enter semi-major a and semi-minor b and verify foci (±c,0) and eccentricity, catching a−b shortcuts and wrong-axis placement of the foci.
Reflector and orbit layout
Place sources and receivers at the two foci of an elliptical mirror, room, or nearly circular orbit using frozen design semi-axes without a full CAD stack.
LMS and exam auto-grading
Mark ellipse-foci items with a deterministic oracle that rejects minor > major and never invents area or perimeter when only the foci are required.
FAQ
How do I calculate the foci of an ellipse from the semi-axes?
Send positive semi-major a and semi-minor b with b ≤ a.
What happens if the minor axis exceeds the major?
Unlike multi-metric ellipse tools that may swap axes, this calculator requires b ≤ a so major/minor labels stay honest. Invalid input is not billed.
Which units does the ellipse foci calculator use?
Any consistent length unit. Outputs are in the same unit as a and b. The calculator does not convert between metres, inches, or pixels.
What is special about the foci of an ellipse?
From any point on the curve, the distances to the two foci always add up to the same total, twice the semi-major axis. With a semi-major axis of 5 that total is 10, the basis of the classic string construction.
What mistake do people make when finding the foci?
Subtracting the semi-axes instead of their squares. The focal distance is the square root of a squared minus b squared, so 5 and 3 give 4. Placing the foci on the minor axis is the other classic slip.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geom/ellipse-foci \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":5,"b":3}'const res = await fetch("https://api.kit.forhosting.com/geom/ellipse-foci", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 5,
"b": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/ellipse-foci",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 5,
"b": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/ellipse-foci", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":5,"b":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":5,"b":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/ellipse-foci", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 5,
"b": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.ellipse_foci",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
When the minor axis exceeds the major the request fails with invalid_input instead of silently swapping axes, so callers that already labeled a as major never get a surprise orientation.
What ellipse foci mean and how c is derived from the semi-axes
This endpoint intentionally answers only that foci question: it does not return area, perimeter, or a Ramanujan approximation, and it does not auto-promote the larger of two unordered numbers to semi-major. Keeping the contract to two ordered semi-axes and a foci-first payload makes the calculator ideal as a two-field form, a homework check, or a one-line step in a larger geometry pipeline that already fixed a and b from a drawing.
Input contract, response shape, and error behaviour
Each must be a finite positive number. Example: semi-major five and semi-minor three yield c equal to four, foci at four zero and negative four zero, eccentricity four fifths, and interfocal distance eight. Units are caller-defined: if you send centimetres you get centimetres of focal distance; if you send metres you get metres. The calculator does not convert units, prove that a and b came from a measured figure, or rotate the major axis to vertical. Pair the numeric result with your own unit labels and drawings. Keep requests small, pin the rounded foci in tests, and you get reproducible center-to-focus results for homework, LMS plugins, and edge workers without standing up a computer-algebra system. POST a JSON body with two required fields: a for the semi-major axis length and b for the semi-minor axis length. Fields may arrive as JSON numbers or as numeric strings; empty strings, missing fields, Infinity, and NaN fail with invalid_input naming the problem. Aliases semi_major, semi_axis_a, semiAxisA, and A map to a; semi_minor, semi_axis_b, semiAxisB, and B map to b so clients that already use longer geometry names do not need a rename layer. On success the body includes the echoed a and b rounded to twelve decimal places for stable goldens, c and focal_distance both equal to the rounded square root of a squared minus b squared, foci_distance equal to twice that value, eccentricity equal to c over a, is_circle true when a equals b, foci as the ordered pair of points positive c zero and negative c zero, equation equal to the standard horizontal string, and formula equal to a short closed-form summary.
Where an ellipse foci calculator earns its keep
Optics and acoustics workflows that place elliptical reflectors need the two foci so that a source at one focus reflects toward the other; freezing a and b from a design drawing and calling this endpoint yields placement coordinates without importing a full CAD kernel. Engineering notebooks and spreadsheet replacements can call this endpoint as a two-field step when a larger script already holds semi-axes for several figures and only the foci case needs a dedicated, SEO-clear name distinct from full ellipse metric suites or perimeter-only tools. In all of those settings the value is not exotic mathematics: it is a stable contract, clear errors when the minor exceeds the major, and a search intent that matches how people actually query for ellipse foci and focal distance from two semi-axes at $0.002 per successful API call.
Technical questions
What are the foci of a circle?
When a equals b the figure is a circle, c is zero, eccentricity is zero, is_circle is true, and both foci sit at the origin (0, 0).
What does the ellipse foci calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.