# Orbiting in space

### Background

I'm making a game where a spaceship needs to orbit another object in space at a set distance.

Space is, unlike other game, like space is in reality. Friction less. (at least to my understanding)

### Question

How do I calculate the direction and strength of the impulse that one "space ship" must emit in order to fall in to and maintain an orbit around another object?

### Note on gravity

There is none in this simulation. Yet.

### My own thoughts so far

To maintain the orbit, the impulse would always have to be directed directly towards the object.

I think my problem is how to fall into the orbit. What I do so far is I try to aim for a point 90 degrees off from my own incoming vector, and as I approach closer I turn towards the object and impulse towards it.

I think my problem is very related to that I do not keep to a maximum speed on my approach, this makes me fly wildly out of the orbit right away.

• in a nutshell, I'd start with calculating simple orbits, as most of the time, the ship would presumably not be using thrusters. Once you have the simple orbital ellipse down, calculate approach and departure. In a nutshell, all a ship needs to do to fall into orbit around a planet is slow down as it approaches. This slowdown can be accomplished by engines or by using a near-by moon for a gravity assist (assists can speed up or slow down approach), or by atmospheric drag (aerobraking) or slow-down by engines. My math is ugly these days though, I wouldn't want to try. Commented Jul 1, 2016 at 20:15
• Question: how to you reconcile "To maintain the orbit, the impulse would always have to be directed directly towards the object." with the behavior of the moon? Commented Jul 1, 2016 at 20:15
• Oh, and, the simplest way to maintain orbit is by orbital velocity, not by constant impulse. Commented Jul 1, 2016 at 20:16
• What you are looking for is simply Newton's second law: $\vec F = m\vec a$. You take your trajectory (any trajectory), differentiate twice with respect to time and multiply with the mass. That's the required force to stay on that trajectory. You also have to chose the initial velocity properly, of course. Commented Jul 1, 2016 at 20:19
• "Friction less. (at least to my understanding)". Friction, as you call it, is completely absent, so as you probably already know, turning a rocket engine on creates momentum that can only be changed by an oppositely directed impulse.
– user108787
Commented Jul 1, 2016 at 20:21

If there is no gravity in your simulation, your thoughts are on the right lines.

The amount of centripetal force (=thrust) required to maintain a space-craft of mass m in circular orbit of radius r at speed v is $F=mv^2/r$. Thrust has to be directed towards the centre of the circle and has to be maintained constantly - so unlike orbiting a planet using gravity, this could use up a lot of fuel.

First decide your orbital radius r and orbital period T. Calculate the required orbital speed $v=2\pi r/T$. Then head at this speed v for a point at distance r from the object making a 90 degree angle with the object and your current location - ie a tangent point on your intended orbit. When you get there (not before, not after) turn on your thrust $F=mv^2/r$ towards the object. If this exact amount of thrust is not maintained, you will not remain in a circular orbit.