This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines and Scratch Wiki:Editing Conventions. (December 2020) Reason: Writing is difficult to understand |
Projectile motion is when object experiences a motion when it's thrown onto the planet and follows a curved path under the pull of gravity. A parabola, or straight line, can show this path of motion.
Forms of Use
It is possible to use projectile motion to figure out how far an object travels in a 2D space (left, right, up, and down). These calculations can be used to create realistic games, simulations, animations, and more.
Tutorial
To simplify this equation, the tutorial assumes that Air Resistance is not included.
Equations
To calculate projectile motion, it is important to understand what and why something is being calculated. There are two inputs in the model: initial speed and angle. With these two inputs, the first variable that needs to be found is Time. The equation used to calculate time is:
Time = (Y-Velocity At Finishing - Y-Velocity At Starting) ÷ Gravity
Note: | On Earth, gravity is approximately equal to |
After time has been solved, Distance Traveled needs to be calculated. The equation used to solve the distance is:
X Displacement = Initial X Position • Time
However, the equations can be solved, the x direction and y direction need to be found first. This can be done after the user inputs the initial velocity and angle launched.
Scripts
Before anything can be done, these variables need to be created:
(init vel) (angle) (init vel x) (init vel y) (final vel y) (time) (displacement)
At the start, they need to be assigned with some values:
when green flag clicked ask [Initial Launch Speed] and wait set [init vel v] to (answer) ask [Launch Angle] and wait set [angle v] to (answer)
Given the initial speed and angle, the velocities in the x direction and y direction need to be calculated:
set [init vel x v] to ((init vel)*([cos v] of (angle))) set [init vel y v] to ((init vel)*([sin v] of (angle))) set [final vel y v] to ((0)-(init vel y))
With these values set, time and distance traveled can be calculated:
set [time v] to (((final vel y)-(init vel y))/(-9.81)) set [displacement v] to ((init vel x)*(time))
This model can be used in multiple scenarios. An example is a projectile launch simulation. A realistic game can be created with this model (provided that other accurate physics is included).