How does inertia and gravity work together to keep the moon orbiting the Earth and relationship between gravity and the orbital pattern of an object?