- Navigate to the downloaded files where the current working directory is
airplane-visualization - Given npm is installed on the local machine, run
npm run build - Next, run
npm run preview - You should now be able to access the simulation using localhost
- Enter the desired values for speed and yaw angle, then press apply.
- Repeat step 6 as much as you would like!
By using the kinematic equations:
x = xo + v * cos(
y = yo + v * sin(
where:
y = current y position
x = current x position
xo = initial x position
yo = initial y position
v = current velocity (user input)
We are able to calculate the new position of the airplane given a change in velocity and angle. cos(
By storing the position of the airplane, we are able to draw the trajectory using the previous values and the relative distance from the current position.