I've scored the internet for sources and have found a lot of useful information, but they are math sites trying to tell me how to solve what angle an object has to be at to reach y location. However, I'm trying to run a simulation, and haven't found any solid equations that can be implemented to code to simulate a parabolic curve. Can those with some knowledge of physics help me on this?
Understanding projectile motion is important to many engineering designs. Any engineered design that includes a projectile, an object in motion close to the Earth's surface subject to gravitational acceleration, requires an understanding of the physics involved in projectile motion.
While Benny's answer is good, especially in its generality, you can solve your problem exactly rather than using finite integration steps. The equation you want is:
s = u*t + 0.5*a*t^2;
Look here for an explanation of where this comes from.
Here s is the displacement, u is the initial speed, a is the acceleration and t is time. This equation is only 1 dimensional, but can be easily used for your problem. All you need to do is split the motion of your projectile into two components: one parallel to your acceleration and one perpendicular. If we let Sx describe the displacement in the x direction and Sy the displacement in the y direction we get:
Sx = Ux*t + 0.5*Ax*t;
Sy = Uy*t + 0.5*Ay*t;
Now in your particular example Ax is 0 as the only acceleration is due to gravity, which is in the y direction, ie Ay = -g. The minus comes from the fact that gravity will be acting in the opposite direction to the original motion of the object. Ux and Uy come from simple trigonometry:
Ux = U*cos(angle);
Uy = U*sin(angle);
Putting this all together you get two equations describing where the projectile will be at a time t after being launched, relative to its starting position:
Sx = U*cos(angle)*t;
Sy = U*sin(angle)*t - 0.5*g*t^2;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With