2D Orbit Simulator

summary

Simulate a 2D orbit with adjustable mass, distance, and velocity.

prompt

This application is a 2D orbit simulator where a small object moves around a massive central body influenced by gravity. Users can adjust the central mass (1–1000 Earth masses), initial distance (1–100 units), and initial tangential velocity (0–50 units, default 1) using sliders. Changing any of the values immediately restarts the simulation. The app continuously draws the orbit as a trace and displays a status message indicating whether the object is in a stable orbit, has escaped, or has crashed into the central body, based on distance thresholds.

original prompt

Create a 2D simulator of a small object orbiting a massive central body due to gravity. Include a form with sliders to adjust the central mass (1–1000 Earth masses), initial distance (1–100 units), and initial tangential velocity (0–50 units, default 1).

When values in the form are changed, immediately restart the animation.

Animate and draw the orbit and indicate whether the object remains in orbit, escapes, or crashes into the central body.

Q: How should the simulator determine the conditions for crashing, escaping, or stable orbit (e.g., thresholds for distance or energy)?
A: thresholds for distance

Q: Would you like the orbit to be drawn as a continuous trace over time, or should only the current position of the object be displayed?
A: yes

Q: Do you want to display a status message (such as 'Orbiting', 'Escaped', 'Crashed') on the screen to indicate the current state of the simulation?
A: yes

generation cost summary

model name: o3-mini-medium

response time: 20.00 sec.

result tokens: 4,100

cost: $0.01854820