Skip to content

sonjand/airplane-visualization

Repository files navigation

How to Run

  1. Navigate to the downloaded files where the current working directory is airplane-visualization
  2. Given npm is installed on the local machine, run npm run build
  3. Next, run npm run preview
  4. You should now be able to access the simulation using localhost
  5. Enter the desired values for speed and yaw angle, then press apply.
  6. Repeat step 6 as much as you would like!

Math Breakdown

By using the kinematic equations:

x = xo + v * cos($\theta$) * $\Delta$ * T and

y = yo + v * sin($\theta$) * $\Delta$ * T,

where:

y = current y position

x = current x position

xo = initial x position

yo = initial y position

v = current velocity (user input)

$\theta$ = difference between previous user input and current input of daw

$\Delta$ * T = change in time, which is defined as a constant value = 0.1

We are able to calculate the new position of the airplane given a change in velocity and angle. cos($\theta$) gives us the horizontal component of the v vector, while sin($\theta$) gives us the vertical component. $\Delta$ * T is defined as the change in time between the changes in position. Note: $\Delta$ * T is multiplied by 10 for scaling purposes due to the small size of the canvas.

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors