Not to overcomplicate things, but a (acceleration of ball) is not a constant "g", but a summation of acceleration due to gravity, Drag, and Lift.
Change in gravity is a function of Y.
Acceleration due to drag is a function of velocity where a_d = .5*rho*V^2*Cd / M_ball (rho = air density (function of temperature), Cd = drag coefficient for spherical ball, M_ball = ball mass)
Acceleration due to lift is a function of ball spin where a_l = 16/3*pi^2*R^3*alpha*rho*V
(alpha is spin rate in radians/sec, R is ball radius), perpendicular to the spin axis
Sum the forces together in 3 dimensions to get the actual "a" in your equation, but calculating the final position would require iteration or an ODE solver.
Maybe this could be a good student summer post-build season project
