Relativistic perihelion precession calculator
Mercury's orbit, with a semi-major axis of 57909050000 m and eccentricity 0.20563, advances 0.10351735428 arcseconds per orbit under general relativity. Enter any bound orbit to get the shift in radians, arcseconds and degrees. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Semi major axis
- 57,909,050,000
- Eccentricity
- 0.20563
- Gravitational parameter
- 132,712,440,018,000,000,000
- C
- 299,792,458
- One minus e2
- 0.9577163031
- Shift radians
- 0.0000005019
- Shift arcseconds
- 0.1035173543
The slow advance of an orbit’s perihelion was the first precision triumph of Einstein’s general relativity and remains a classroom and research staple for solar-system tests of gravity. This relativistic perihelion precession calculator takes the semi-major axis, eccentricity, and central gravitational parameter, evaluates the classic weak-field Schwarzschild formula for the angular advance per closed revolution, and returns the result in radians, arcseconds, and degrees per orbit. Students can reproduce Mercury’s famous ~0.1 arcsecond per revolution; mission designers can estimate GR corrections for highly eccentric flybys around the Sun or compact objects when the two-body Schwarzschild model is enough. Eccentricity that reaches one is rejected because the closed-orbit formula no longer applies.
What the GR perihelion formula computes
In Newtonian gravity a fixed inverse-square force produces a closed ellipse with periapsis locked in inertial space for the pure two-body problem. General relativity adds a small excess advance of the line of apsides each revolution.
For a test particle on a bound orbit about a non-spinning central mass in the weak-field limit, that advance per orbit is the closed form Δφ equals six pi times μ divided by c squared times a times one minus e squared, where μ is the standard gravitational parameter GM, a is the semi-major axis, e is the eccentricity, and c is the speed of light.
The formula is the standard first post-Newtonian result quoted in textbooks and used historically to match Mercury’s residual perihelion motion after planetary perturbations are removed. Use the result as the pure GR two-body apsidal kick per revolution, then fold period and other corrections in your own pipeline if you need rates per century or full ephemeris residuals.
Input contract, units, and error behaviour
Semi-major axis and gravitational parameter must be strictly positive. On success the body echoes the cleaned inputs, the speed of light used, one minus e squared, and the shift in radians, arcseconds, and degrees per orbit, plus a units map, method tag, formula string, and approximation label.
Example: Mercury-scale values near a equals five point seven nine times ten to the ten metres, e about zero point two zero five six, and solar μ about one point three two seven times ten to the twenty cubic metres per second squared produce a shift near one tenth of an arcsecond per orbit—the classic GR figure. Failed validation is not billed.
Keep a and μ in SI so c cancels consistently; if you work in astronomical units you must convert to metres and m³ s⁻² first or scale μ yourself before calling.
Where this perihelion calculation helps
Astrophysics and general-relativity courses use a relativistic perihelion precession calculator so learners can plug in Mercury, binary-pulsar scale, or toy parameters and see the arcsecond-per-orbit advance without deriving the post-Newtonian expansion by hand. Exam generators and LMS plugins need a deterministic oracle that rejects parabolic and hyperbolic eccentricity instead of silently returning nonsense.
Pin the rounded arcseconds field in tests, document that the output is per orbit not per century, and you get reproducible GR apsidal advances for teaching, SEO demos, and edge workers without standing up geodesic machinery of your own.
What you can do with it
Classroom GR and orbital mechanics checks
Let students enter a, e, and μ for Mercury or a toy star and verify the arcseconds-per-orbit GR perihelion advance against textbook worked examples.
Exam and LMS auto-grading
Mark perihelion-precession items with a deterministic oracle that rejects e ≥ 1 and never invents a closed-orbit shift for parabolic paths.
Mission and ephemeris notebooks
Insert the pure Schwarzschild two-body apsidal kick per revolution into scripts before adding J2, drag, or n-body terms in your own stack.
FAQ
What happens when eccentricity reaches one?
The closed-orbit perihelion formula requires a bound ellipse (e < 1); parabolic and hyperbolic cases are rejected rather than returning infinity.
Is the result in arcseconds per orbit or per century?
Per orbit (per revolution). To get arcseconds per century multiply by the number of revolutions in a century using the orbital period from Kepler’s law or your ephemeris.
Which value of the speed of light is used?
Keep a and μ in SI units so the formula is dimensionally consistent.
Why does Mercury's perihelion move at all?
In Newtonian gravity a two-body orbit is a closed ellipse with a fixed closest point. General relativity adds a small extra advance every revolution, about a tenth of an arcsecond for Mercury, which matched its leftover motion.
Does the result include the pull of other planets?
No. It is the pure two-body relativity term per orbit around a non-spinning mass. Planetary perturbations, frame-dragging and the Sun's flattening must be added in your own model.
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/relativistic-perihelion-shift \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"semi_major_axis":57909050000,"eccentricity":0.20563,"gravitational_parameter":132712440018000000000}'const res = await fetch("https://api.kit.forhosting.com/astro/relativistic-perihelion-shift", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"semi_major_axis": 57909050000,
"eccentricity": 0.20563,
"gravitational_parameter": 132712440018000000000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/relativistic-perihelion-shift",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"semi_major_axis": 57909050000,
"eccentricity": 0.20563,
"gravitational_parameter": 132712440018000000000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/relativistic-perihelion-shift", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"semi_major_axis":57909050000,"eccentricity":0.20563,"gravitational_parameter":132712440018000000000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"semi_major_axis":57909050000,"eccentricity":0.20563,"gravitational_parameter":132712440018000000000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/relativistic-perihelion-shift", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"semi_major_axis": 57909050000,
"eccentricity": 0.20563,
"gravitational_parameter": 132712440018000000000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.relativistic_perihelion_shift",
"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
What the GR perihelion formula computes
This calculator evaluates that expression in deterministic floating-point arithmetic with the exact SI value of c, so identical inputs always yield identical JSON. It does not integrate the geodesic equations, does not include frame-dragging or solar quadrupole moments, and does not convert arcseconds per orbit into arcseconds per century; those steps require the orbital period and optional multipole models that live outside this endpoint.
Input contract, units, and error behaviour
POST a JSON object with three required finite numbers: semi_major_axis in metres, eccentricity as a dimensionless value with zero less than or equal to e less than one, and gravitational_parameter μ equals GM in cubic metres per second squared. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, and non-finite values fail with invalid_input naming the field.
Where a perihelion precession API earns its keep
Research notebooks that compare GR against planetary ephemerides or spacecraft ranging often need a single-line two-body GR term before stacking solar J2 and n-body perturbations; a tiny parse API avoids importing a full GR integrator for that one closed form.
Technical questions
How is relativistic perihelion precession calculated?
Send semi_major_axis a (m), eccentricity e with 0 ≤ e < 1, and gravitational_parameter μ = GM (m³/s²). The API returns Δφ = 6πμ/(c² a (1−e²)) in radians, arcseconds, and degrees per orbit.
What does the relativistic perihelion precession calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.