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

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.

Inputs of N-Body & Three-Body Orbit Simulator
FieldTypeDefaultDescription
presetselect (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
bodiestextarea—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.
durationnumber—Duration (time units). Empty: one period for the periodic presets, 70 for the Pythagorean problem, 10 for your own bodies.
methodselect (rk45, yoshida4, verlet)"rk45"Integrator
tolerancenumber1e-11Tolerance (RK45). Relative error per step of the adaptive method.
stepnumber—Step size (fixed-step methods). Empty: the period (or the duration) divided by 20,000.
Gnumber1Gravitational constant G
softeningnumber0Softening length. Plummer softening ε: the force uses r² + ε², which tames close encounters but changes the physics slightly.
outputPointsinteger801Output 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)

{
  "mcpServers": {
    "proofline-nbody": { "type": "http", "url": "https://prooflinenbody.usefulweb.app/mcp" }
  }
}