In my scant spare time I'm building an Asteroids game. You know - a little ship equipped with a pea shooter and a bunch of asteroids floating around everywhere waiting to be to blown up. But, I wanted to add a little twist. Wouldn't it be cool if Newtonian gravity was in effect and you could do thinks like enter into an orbit around an asteroid and fire at it, or shoot gravity assisted bankshots around a massive asteroid so that you can shoot one behind it.
But the problem is that in asteroids, space is topologically toroidal. If you fly off of the top of the screen, you reappear at the same x coordinate at the bottom of the screen (and similarly for the right of the screen). So how does one calculate the distance between two bodies in this space? Really, I realize that this question doesn't make sense because body A would pull upon body B from a variety of directions each with their corresponding distances.
But anyway, the main questions: How would Newtonian gravity work in toroidal space? AND Is there any applicability to the answer to this question outside of my game?
Answer
Forgetting about the specifics of your problem, you say you want to work in the Newtonian regime for gravitation on a toroidal space. The way this differs from a non-toroidal space is that you can "unroll" the torus into an infinite lattice of duplicates. This is a lot like the lattice of mirror charges if you were doing electrostatics on a torus (the problems are clearly equivalent). So, the force from body B on body A is the sum of the forces of all B's multiple copies, one per cell in the unrolled version. Add each of these force vectors together, and there's the force exerted by B on A in this toroidal universe. So that's an infinite sum but the terms die off like $\text{distance}^{-2}$.
Back to your problem though, it may just be easier to neglect that detail and simply compute the force between A and the "nearest copy" of B.
No comments:
Post a Comment