Question: Step 5 : Show the expected trajectory You should be able to calculate the trajectory of the rocket from the kinematics equations we used towards
Step : Show the expected trajectory
You should be able to calculate the trajectory of the rocket from the kinematics equations we used towards the beginning of the course. In this step you will calculate this trajectory and draw it on the screen using drawPointxdrawydraw; You may recognize this as the same function we used to do the projectile in the planetoids lab.
Just after drawLinewidth,; add this code which will draw a series of points for the position of the object:
x;
y;
Npoints;
fori;iNpoints;i
t idt;
xdraw x;
ydraw y;
drawPointxdrawydraw;
Fill in the with the terms that give the right trajectory. The two equations at the beginning of this exercise should be a big help! The main problem is how to put this in the code and what to use for vx
and vy
Advice #: Expressions like t won't work in this case or in most other programming languages Instead use tt for t
Advice #: Don't use vx or vy here because those variables will change after the object is launched.
Advice #: Remember that the initial speed is v
Advice #: You may want to use some trig functions like costheta and sintheta It's important that your trajectory is correct for different values of theta.
Ultimately your code should behave like this.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
