Trajectory refactor

Here's my code for the generalized trajectory computation. Thanks for the project it was interesting and fun to flex my physics chops again!