Hyperbolic semi-major axis calculator
For Earth, a flyby with an excess speed of 3 km/s follows a hyperbola with a semi-major axis of −44288.9379778 km. Enter the central body's μ and the hyperbolic excess speed to get the signed semi-major axis and its size. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mu
- 398,600.4418
- V inf
- 3
- Semi major axis
- -44,288.9379778
- Abs semi major axis
- 44,288.9379778
Hyperbolic trajectories appear whenever a spacecraft, comet, or interplanetary probe approaches a planet with more energy than a bound elliptical orbit can hold. The size of that path is summarized by a single negative length: the semi-major axis a equals minus the central-body gravitational parameter μ divided by the square of the hyperbolic excess velocity v-infinity. Keep μ and v-infinity in consistent units so a comes out in the matching length unit.
What the semi-major axis of a hyperbola tells you
A spacecraft, comet or probe that approaches a planet with more energy than a closed orbit can hold follows a hyperbola, not an ellipse. Its size is summarised by one length, the semi-major axis, which for a hyperbola is negative. The calculator finds it from the planet's μ, which is G times its mass, and from the hyperbolic excess speed, the speed the object keeps far away from the planet. Textbooks often plot the size of a as a characteristic length, but the signed value is the one that appears in the orbit equations.
How it is calculated and common mistakes
The formula is a equals minus μ divided by the excess speed squared. For Earth, with μ of 398600.4418 km³/s² and an excess speed of 3 km/s, a is −44288.9379778 km. Typical mistakes are mixing units, such as μ in cubic metres with a speed in kilometres per second, dropping the minus sign when the value feeds the orbit equation, and entering zero excess speed, which is rejected because the formula would divide by zero.
FAQ
Why is the semi-major axis negative?
By convention the semi-major axis of a hyperbolic conic is negative.
Is the hyperbolic orbit semi-major axis calculator free?
The browser tool runs free on your device.
What is the semi-major axis for Earth with an excess speed of 3 km/s?
With μ = 398600.4418 km³/s² and an excess speed of 3 km/s, the semi-major axis is −44288.9379778 km. Its size without the sign, 44288.9379778 km, is shown as well for plots and comparisons.
Which units should I use?
Keep μ and the excess speed consistent: μ in cubic kilometres per second squared with a speed in kilometres per second gives the result in kilometres, while SI units give it in metres.
What happens if the excess speed is zero?
It is rejected. With zero excess speed the formula would divide by zero, so the calculator returns a clear input error instead of a number. The value of μ must also be strictly positive.
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/astro/hyperbolic-semimajor \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mu":398600.4418,"v_inf":3}'const res = await fetch("https://api.kit.forhosting.com/astro/hyperbolic-semimajor", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mu": 398600.4418,
"v_inf": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/hyperbolic-semimajor",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mu": 398600.4418,
"v_inf": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/hyperbolic-semimajor", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mu":398600.4418,"v_inf":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mu":398600.4418,"v_inf":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/hyperbolic-semimajor", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mu": 398600.4418,
"v_inf": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.hyperbolic_semimajor",
"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
This capability evaluates that closed form deterministically from two finite numbers, rejects zero excess velocity with a clear invalid input error, and returns structured JSON that homework checkers, mission concept tools, and lightweight flyby pipelines can pin in continuous integration without installing a full orbital mechanics stack.
What the negative semi-major axis means for a hyperbola
Under Newtonian two-body gravity, specific mechanical energy and the shape of the conic section are tightly linked. When energy is positive, the path is a hyperbola and the classical semi-major axis is defined as a equals minus μ over two times energy, or equivalently a equals minus μ over v-infinity squared when energy is expressed through the asymptotic excess speed. The result is always negative when μ is positive and v-infinity is non-zero: textbooks often plot the magnitude of a as a characteristic length, but the signed value is what appears in the orbit equation and in relations such as periapsis radius equals a times one minus eccentricity with a negative. Both must be finite. Mu must be strictly positive. Send the required field mu as a JSON number or numeric string for the central-body gravitational parameter GM—Earth in SI is about three point nine eight six times ten to the fourteen cubic meters per second squared, or about three hundred ninety-eight thousand six hundred cubic kilometers per second squared in common mission units. Send the required field v_inf for the hyperbolic excess velocity, the speed relative to the central body far from closest approach. Aliases gravitational_parameter, gm, and GM are accepted for mu; hyperbolic_excess_velocity, excess_velocity, vinf, and v_infinity for v_inf. V_inf must be non-zero: zero excess velocity is the parabolic boundary case, the formula divides by zero, and the engine returns invalid_input rather than infinity. Negative v_inf values are allowed numerically because only the square enters the formula; prefer a non-negative speed for clarity. Identical inputs always produce identical JSON because the path is pure floating-point arithmetic with no network, no random seed, and no wall clock.
Reading the response fields and keeping units consistent
The calculator does not convert units for you. On success the response echoes mu and v_inf, then reports semi_major_axis as the signed negative length a equals minus mu over v_inf squared, and abs_semi_major_axis as the positive magnitude mu over v_inf squared for displays that want a length without the sign. The formula field is always the string a equals minus mu over v_inf squared in compact form, and method is always hyperbolic_semimajor so downstream code can branch without sniffing shapes. Units are your responsibility: with μ in cubic kilometers per second squared and v_inf in kilometers per second, semi_major_axis is in kilometers; with SI cubic meters per second squared and meters per second, a is in meters. Missing mu, missing v_inf, zero v_inf, non-positive mu, and non-finite numbers all fail with invalid_input and are not charged after the engine rejects the request. Use semi_major_axis when you need the signed conic parameter for further Keplerian algebra; use abs_semi_major_axis when a dashboard only plots a characteristic scale; keep formula and method when documenting the physics step for students or when logging which algorithm produced a flyby sketch. Pair this endpoint with apoapsis-periapsis or orbital-energy tools when the next question is a different search intent—those landings serve bound or circular cases and should not be confused with hyperbolic sizing.
API usage, pricing, classroom workflows, and practical limits
Call the free in-browser hyperbolic orbit semi-major axis calculator for homework checks, lecture demos, and quick flyby concept verification without installing Orekit, GMAT, or a local MATLAB toolbox. Typical classroom examples include Earth gravity with a few kilometers per second of excess speed for an interplanetary departure hyperbola, a planetary flyby with a stated asymptotic speed, and simplified solar-system problems with solar μ and a chosen v-infinity—always with matching units. Extremely large or tiny magnitudes are bounded for isolate safety; stay within the published numeric range for reliable results. Send a JSON body with required positive mu and required non-zero v_inf. Use the prepaid API when a tutoring platform, coding-assessment sandbox, curriculum generator, or early mission-design pipeline needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after rejection. Authors shipping SDKs can map semi_major_axis into tables that show how larger excess velocity shrinks the absolute size of the hyperbola while smaller excess velocity makes the path more open and the magnitude of a grow without bound as the parabolic limit is approached.
Integration use cases
Homework and exam verification
Students and graders compute the negative semi-major axis a=−μ/v∞² for given gravitational parameter and hyperbolic excess velocity, compare against textbook answers, and get a clear invalid_input error when excess velocity is zero by mistake.
Tutoring and curriculum generators
Lesson builders produce worked hyperbolic-orbit examples with structured JSON for flashcards, step sheets, and auto-graded drills without embedding a full astrodynamics library.
Early flyby and departure concept sketches
Lightweight pipelines that need a stable hyperbolic size check from μ and v∞ call a prepaid endpoint instead of reimplementing a=−μ/v∞² in every language.
Technical questions
How do I calculate the semi-major axis of a hyperbolic orbit?
Send JSON with mu (gravitational parameter GM) as a positive finite number and v_inf (hyperbolic excess velocity) as a non-zero finite number. The response includes semi_major_axis equal to −μ / v_inf² and abs_semi_major_axis equal to μ / v_inf².
What happens if hyperbolic excess velocity is zero?
The request fails with invalid_input. Zero excess velocity is not a hyperbolic orbit: the formula a=−μ/v_inf² divides by zero and corresponds to the parabolic energy boundary.
Which units should I use for μ and v_inf?
Any consistent pair works. Common choices are km³/s² with km/s (a in km) or m³/s² with m/s (a in m). The engine does not convert units; mismatched units produce a numerically wrong length.