- #1
S Holtom
- 39
- 10
- TL;DR Summary
- Part comp sci part astronomy...not sure where to put this
I've tried to make a "naive" implementation of a planet orbiting a gravitational point source, in Processing (basically Java).
Gravity is a constant, and adds to the planet's velocity inversely proportional to the square of distance. I start the planet off with a tangential velocity.
I get an elliptical orbit, as desired, but the planet orbits faster and faster until it is ejected. What am I missing? Or is it really the case that very precise values are needed for a stable orbit?
(I'll post the source code shortly, it's on another machine)
Gravity is a constant, and adds to the planet's velocity inversely proportional to the square of distance. I start the planet off with a tangential velocity.
I get an elliptical orbit, as desired, but the planet orbits faster and faster until it is ejected. What am I missing? Or is it really the case that very precise values are needed for a stable orbit?
(I'll post the source code shortly, it's on another machine)