Find coefficients such that the path of the ball through time is given by: x(t) = ax * t^2 / 2 + bx * t + cx y(t) = ay * t^2 / 2 + by * t + cy z(t) = az * t^2 / 2 + bz * t + cz We start with velocity and location of ball when y = 50 and use extension to derive coefficients
Usage
get_quadratic_coef(data, source = c("statsapi", "baseballsavant"))
Arguments
- data
a dataframe with the columns required for calculating the quadratic coefficients. If
source = "statsapi"
, thenax
,ay
,az
,vx0
,vy0
,vz0
,x0
,z0
, andextension
are required. Ifsource = "baseballsavant"
, thenax
,ay
,az
,vx0
,vy0
,vz0
,release_pos_x
,release_pos_y
, andrelease_pos_z
are required.- source
character string, either "statsapi" (default) or "baseballsavant"