Updated the trejactory calculation.

The calculation is now performed at the same intervals as the game. This
means that it is much less efficient, but much more accurate. The number
of calculations to do can be reduced, or there may be a way of doing
approximations in the future.