Note
Click here to download the full example code
Batted Ball DataFrameΒΆ
Out:
t x y ... vx vy vz
0 0.000449 4.489146e-07 2.057054 ... 0.001999 127.023514 73.335701
1 0.004940 5.424690e-05 2.627042 ... 0.021945 126.799801 73.192772
2 0.014940 4.946582e-04 3.892560 ... 0.066073 126.304384 72.874912
3 0.024940 1.374407e-03 5.153142 ... 0.109813 125.812655 72.557575
4 0.034940 2.689640e-03 6.408826 ... 0.153170 125.324581 72.240755
.. ... ... ... ... ... ... ...
555 5.544940 2.272305e+01 403.831362 ... 4.709781 53.639244 -60.688468
556 5.554940 2.277012e+01 404.367694 ... 4.705682 53.627329 -60.844866
557 5.564940 2.281716e+01 404.903909 ... 4.701562 53.615575 -61.000837
558 5.574940 2.286415e+01 405.440006 ... 4.697423 53.603980 -61.156382
559 5.584940 2.291111e+01 405.975989 ... 4.693263 53.592545 -61.311501
[560 rows x 7 columns]
96.61022053816268
from pybbda.analysis.trajectories import BattedBallTrajectory
trajectory_calc = BattedBallTrajectory()
trajectory = trajectory_calc.get_trajectory(
initial_speed=100,
launch_angle=30,
launch_direction_angle=0,
initial_spin=2500,
spin_angle=-10,
)
print(trajectory)
print(trajectory.z.max())
Total running time of the script: ( 0 minutes 0.219 seconds)