API & MCP
Everything a person can do on N-Body & Three-Body Orbit Simulator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://prooflinenbody.usefulweb.app/api/v1/calculate– run N-Body & Three-Body Orbit SimulatorGET https://prooflinenbody.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
N-Body & Three-Body Orbit Simulator
Simulate point masses under Newtonian gravity in a plane: published three-body periodic orbits (figure-eight, butterflies, moths, yin-yang and more from Šuvakov & Dmitrašinović 2013 and the 10-digit refinements of Li & Liao 2017), Lagrange’s triangle, the chaotic Pythagorean problem, or up to 12 bodies of your own. Choose an adaptive Dormand–Prince RK45 or a symplectic Verlet or Yoshida integrator and get the orbit plot, the energy, momentum and angular-momentum drift, the closest approach and how far a periodic orbit is from its start after each full period. Part of the Proofline math notebook.
| Field | Type | Default | Description |
|---|---|---|---|
preset | select (custom, figure-eight, butterfly-1, butterfly-2, bumblebee, moth-1, moth-2, butterfly-3, moth-3, goggles, butterfly-4, dragonfly, yarn, yin-yang-1a, yin-yang-1b, yin-yang-2a, yin-yang-2b, figur | "figure-eight" | Initial conditions |
bodies | textarea | — | Bodies (custom: one per line). One body per line: an optional name, then mass, x, y, vx and vy (G = 1 units unless you change G). At most 12 bodies. Used when “My own bodies” is selected. |
duration | number | — | Duration (time units). Empty: one period for the periodic presets, 70 for the Pythagorean problem, 10 for your own bodies. |
method | select (rk45, yoshida4, verlet) | "rk45" | Integrator |
tolerance | number | 1e-11 | Tolerance (RK45). Relative error per step of the adaptive method. |
step | number | — | Step size (fixed-step methods). Empty: the period (or the duration) divided by 20,000. |
G | number | 1 | Gravitational constant G |
softening | number | 0 | Softening length. Plummer softening ε: the force uses r² + ε², which tames close encounters but changes the physics slightly. |
outputPoints | integer | 801 | Output points |
Example request
Figure-eight choreography, one period
curl -X POST https://prooflinenbody.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"preset":"figure-eight"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://prooflinenbody.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
proofline_nbody - Local stdio connector:
node src/mcp-stdio.ts --tool=proofline-nbody
{
"mcpServers": {
"proofline-nbody": { "type": "http", "url": "https://prooflinenbody.usefulweb.app/mcp" }
}
}