This simulation here is a result of a task that was supplied to a self-hosted LLM (Qwen2.5-coder-32b):
Create a complete HTML page using Canvas and JavaScript to simulate a three-body effect.
Use the following planet resources:
- https://yourdevops.me/earth.png
- https://yourdevops.me/mars.png
- https://yourdevops.me/moon.png
Requirements:
- Set size of images as 100px * 100px
- Add "Start" and "Reset" button
- When it is not started, allow drag to place the planets, and "start" to simulate
- "Reset" place the three planets to the default location
- Draw both acceleration and velocity vectors on each planet, assume all the planets are stationary at the beginning
- Add a slider to control the update speed
- Set largely different mass to make the movement obvious, set G constant large enough to make the animation obvious too
- Write the entire code in a single HTML file