Pagnatious
New member
- Joined
- Mar 3, 2010
- Messages
- 24
- Reaction score
- 0
- Points
- 0
Hi,
This past while I've been working on a project that involves a 2D simulation of planets and ships/stations moving in orbits. I have built up my knowledge of orbital mechanics and how to calculate and implement variables needed for this mainly from reading wiki and for the forums here, either passively or from the help of people, but my understanding still has gaps.
What follows is a brief description of its process, then a link to an example with some controls.
Here is an example of it http://www.patrickhogan.org/Solar.htm
It has mercury, earth, the moon and mars as well as a ship in green.
Controls (you may have to click in the window to give it focus):
1 - stops time
2 - sets time rate relative to ships orbital period
3 - sets time rate at 100min/sec (starting speed)
4 - sets time rate at 1000min/sec
5 - reduces time rate by 50 (floored at 0, no back in time
6 - increases time rate by 50
- and + zoom in and out
e focuses the camera on Earth
c on the sun,
s on the ship
space on the midpoint between the ship and what it's orbiting.
Arrow keys will change the ships velocity by increasing it in the relative cardinal directions. Crude but only for demo purposes.
Clicking on a different body will change that to be the ships target and as such intercepts will be worked out for that. Need to make it so you can tell more precisely if your path is going to meet where the planet is.
The rings around the planets/moon are their sphere of influence and the ship uses a patched conic approximation approximation for its motion. It's elements are determined based on whose sphere it's in. As it passes down to a new sphere like the moon its position and velocity become relative to it.
I think I got all the bugs out, but feel free to let me know of any if you try it.
Any thoughts, opinions, criticisms or comments are welcomed.
This past while I've been working on a project that involves a 2D simulation of planets and ships/stations moving in orbits. I have built up my knowledge of orbital mechanics and how to calculate and implement variables needed for this mainly from reading wiki and for the forums here, either passively or from the help of people, but my understanding still has gaps.
What follows is a brief description of its process, then a link to an example with some controls.
Here is an example of it http://www.patrickhogan.org/Solar.htm
It has mercury, earth, the moon and mars as well as a ship in green.
Controls (you may have to click in the window to give it focus):
1 - stops time
2 - sets time rate relative to ships orbital period
3 - sets time rate at 100min/sec (starting speed)
4 - sets time rate at 1000min/sec
5 - reduces time rate by 50 (floored at 0, no back in time
6 - increases time rate by 50
- and + zoom in and out
e focuses the camera on Earth
c on the sun,
s on the ship
space on the midpoint between the ship and what it's orbiting.
Arrow keys will change the ships velocity by increasing it in the relative cardinal directions. Crude but only for demo purposes.
Clicking on a different body will change that to be the ships target and as such intercepts will be worked out for that. Need to make it so you can tell more precisely if your path is going to meet where the planet is.
The rings around the planets/moon are their sphere of influence and the ship uses a patched conic approximation approximation for its motion. It's elements are determined based on whose sphere it's in. As it passes down to a new sphere like the moon its position and velocity become relative to it.
I think I got all the bugs out, but feel free to let me know of any if you try it.
Any thoughts, opinions, criticisms or comments are welcomed.
Last edited: