O'Reilly logo

The Essential Guide to Physics for Flash Games, Animation, and Simulations by Adrian Dobre, Dev Ramtal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Orbits

With our gravity function, it’s very easy to create a realistic-looking orbits simulation. Figure 6-3 shows a screenshot of what we’ll create: a planet orbiting a sun, against a background of fixed stars. For simplicity, we assume that the sun remains fixed. In reality, as we saw previously, both the sun and the planet will experience a gravitational force of the same magnitude but in opposite directions (with the force on each one pointing toward the other). So both the planet and the sun will move. But if the mass of the sun is much larger than that of the planet, the motion of the sun will be so small it will hardly be perceivable, anyway. That’s because F = ma again, so that the acceleration a = F/m. Thus, if the mass m is very large, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required