<span>Script to calculate the most important quantitative information of the drag parabolic shot in International System of Units.</span><br><span><span lang="en"><span>If you want to use another system of units you can do it by making some simple changes.</span></span></span><br><br><span><span lang="en"><span>This is a first approach to the problem and is totally perfectible.</span></span></span><br><br><span><span lang="en"><span><span lang="en"><span>To calculate the maximum range, a transcendental equation is solved regularly, but here we did a first run with a number of time values left over to approximate the time index for which the vertical position becomes zero.</span></span> </span></span></span><br><br><span>Inputs of the function are:<br>a) initial velocity vo (scalar) [m/s]<br>b) shot angle alfa [degrees]<br>c) (drag coefficient / mass) = b [m^-1]<br><br>Parameter<br>g) gravity acceleration g = 9.81 [m/s^2]<br><br>The outputs of the function are:<br>T_1: ascending time [s]<br>H: maximum height [m]<br>L: maximum horizontal range [m]<br><br>We need to calculate:<br>x: horizontal position at time t [m]<br>y: vertical position at time t [m]<br>vox: horizontal initial velocity [m/s]<br>voy: vertical initial velocity [m/s]<br><br>drag_parabolic &lt;- function(vo, alpha, b){<br>  <br>  g &lt;- 9.81<br>  an &lt;- (2*pi*alpha)/360<br>  vox &lt;- vo*cos(an)<br>  voy &lt;- vo*sin(an)<br>  T_1 &lt;- (1/b)*log(1+(b*voy/g))<br>  H &lt;- (voy/b)-((g/b^2)*log(1+(b*voy/g)))<br>  <br>  # first run<br></span><br><span>  t &lt;- seq(0, 25, 1/10)<br><br>  x &lt;- vector()<br>  y &lt;- vector()<br>  <br>  x &lt;- (vox/b)*(1-exp(-b*t))<br>  y &lt;- ((1/b)*((g/b)+voy)*(1-exp(-b*t)))-((g/b)*t)<br>  <br>  # time index of max. range </span><br><span>  a_T &lt;- which(y &lt; 0)[1]-1<br>  <br>  # second run<br></span><br><span>  t_t &lt;- head(t, a_T)<br>  <br>  xx &lt;- vector()<br>  yy &lt;- vector()<br>  <br>  xx &lt;- (vox/b)*(1-exp(-b*t_t))<br>  yy &lt;- ((1/b)*((g/b)+voy)*(1-exp(-b*t_t)))-((g/b)*t_t)<br>  <br>  R &lt;- round(xx[length(xx)],2)<br>  H &lt;- round(H,2)<br>  </span><br><span>  plot(xx, yy, xlab=&quot;X&quot;, ylab=&quot;Y&quot;, type = &quot;o&quot;, col = &quot;blue&quot;, axes=F)<br>  </span><br><span>  axis(1, at = seq(0,R,R/10),labels = seq(0,R,R/10), cex.axis = 0.7)<br>  axis(2, at = seq(0,H,H/10),labels = seq(0,H,H/10), cex.axis = 0.7)<br>  <br>  print(&quot;Initial Velocity&quot;);print(paste(vo,&quot;m/s&quot;))<br>  print(&quot;Angle of Shot&quot;);print(paste(alpha,&quot;degrees&quot;))<br>  print(&quot;Ascending Time&quot;);print(paste(T_1,&quot;s&quot;))<br>  print(&quot;Maximum Height&quot;);print(paste(H,&quot;m&quot;))<br>  print(&quot;Aprox. Max. Range&quot;);print(paste(R,&quot;m&quot;, &quot;+-2%&quot;))<br>  <br>  legend(R/3, H/2, legend = c(paste(&quot;vo =&quot;, vo, &quot;m/s&quot;),<br>                   paste(&quot;alpha =&quot;, alpha,&quot;degrees&quot;),<br>                   paste(&quot;Ascending time&quot;, paste(T_1,&quot;s&quot;)),<br>                   paste(&quot;Maximum height&quot;, paste(H,&quot;m&quot;)),<br>                   paste(&quot;Aprox. Max. Range&quot;, paste(R,&quot;m&quot;,&quot;+-2%&quot;))),<br>                   cex=0.7, bg = par(&quot;bg&quot;))<br>  </span><br><span>title(main = &quot;Drag Parabolic Shot&quot;, sub = &quot;&quot;)<br>}</span><br><br><span><span lang="en"><span>Let's try the function:</span></span></span><br><br><span>drag_parabolic(50, 45, 0.5)</span><br><br><div><a href="https://2.bp.blogspot.com/-BUk-BkxQQRg/WJOzG3FNGsI/AAAAAAAACxA/1TcIOkpKfS8tzYD6A-jy-dGT-HkXx5iAQCLcB/s1600/drag.png"></a></div><br><span> <span lang="en"><span>We compare with a simple parabolic shot with the same parameters:</span></span></span><br><br><br><div></div><div> <a href="https://4.bp.blogspot.com/-sWa2tSPTrXw/WJO06qxhNdI/AAAAAAAACxY/h4X5-ca6BQoLZhAtW2_ZClJRMe6-xSqTACLcB/s1600/no_drag.png"></a></div><div></div><br><br><span><span lang="en"><span>I will be glad to receive your comments and suggestions to improve the script.</span></span></span><br><span><span lang="en"><span> </span></span> </span><br><span><span lang="en"><span>Get the script in:</span></span></span><br><span><span lang="en"><span><a target="_blank" rel="nofollow" href="https://github.com/pakinja/Data-R-Value/tree/master/Drag_Parabolic_Shot">https://github.com/pakinja/Data-R-Value</a> </span></span></span><br><br>