phetsims / projectile-motion

"Projectile Motion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
15 stars 13 forks source link

Improve accuracy of apex y-position calculation #312

Closed matthew-blackman closed 1 year ago

matthew-blackman commented 1 year ago

The previous way that the apex of a trajectory is calculated is using the linear interpolation of the old and new y-coordinates. This is only accurate if the object has a constant velocity, so will not correctly model the y-position of the apex. We can improve this by using a quadratic function with the dtToApex value.

Note: This will an approximation if air resistance is turned on, just like all of the other calculations in the step function.

zepumph commented 1 year ago

Looks great. Anything else here?

matthew-blackman commented 1 year ago

@zepumph and I confirmed that this improves calculation of the apex height. Any further improvements require integration. Closing this issue.