MCPcopy Index your code
hub / github.com/achristmascarl/three_body

github.com/achristmascarl/three_body @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
10 symbols 15 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

✨ three_body

a very rudimentary simulation of the three-body problem. i was curious how far we could get with just euler's method and a small time step, and it turns out we can get something pretty visually interesting!

three body problem gif

three body problem image

i was also curious about what would happen if the polar coordinates of the bodies over time were translated into rgb values and animated; the results are below.

warning: some of the transitions from this orbit are pretty abrupt, so there may be flashing colors.

three body problem color gif

sources

the starting positions for the graphics above are for periodic orbit F10 from this paper: https://arxiv.org/abs/1805.07980

This is what F10 looks like when solved with ODE solver dop853 (according to the paper):

F10 from the paper

as you can see, although the overall shape is similar/recognizeable, the error in the calculations above grow fairly noticeable after just 2 periods.

Extension points exported contracts — how you extend this code

Theta (Interface)
(no doc) [1 implementers]
src/main.rs

Core symbols most depended-on inside this repo

theta
called by 3
src/main.rs
graph_steps
called by 1
src/main.rs
animate_steps
called by 1
src/main.rs
animate_color_steps
called by 1
src/main.rs
main
called by 0
src/main.rs

Shape

Class 4
Function 4
Interface 1
Method 1

Languages

Rust100%

Modules by API surface

src/main.rs10 symbols

For agents

$ claude mcp add three_body \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact