## ← 02-33 Boost The Rocket

• 2 Followers
• 16 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=WqCmvqRCJeM" data-team="udacity"></div> ``` 1 Language

• English [en]

Showing Revision 2 created 10/24/2012 by Amara Bot.

1. One way of solving this is the following. We check h times the step number, is the current time.
2. If the current time is larger than or equal to 2 hours, and if we didn't fire the boost before,
3. we fire the boost and then remember that we actually did fire the boost.
4. So next time around, the boost is not going to be fired.
5. You could in principle also check for equality over the time exactly equals to ours or not.
6. But that's very dangerous with floating point numbers.
7. You may miss by a very tiny fraction when the boost is to be done,
8. we change the velocity by 300 m/s that is times the vector which looked somewhat crazy.
9. What we need is a vector of length 1 in the right direction, that is in the direction of travel.
10. 300 times that vector is going to provide us
11. with a vector of length 300 in the direction of travel.
12. So what happens to velocity? We take the existing velocity divided by it's length.
13. This way, we get the vector of length 1 in the direction of travel.
14. 300 times this vector is just the vector that we need to change the velocity vector.
15. There is one more line in this solution. If we fire the rocket, we place a red dot and this is the result.
16. We see the orbit starting here and then the rocket boost takes us to a different orbit.