I'm not sure if there even exists a closed form for drag or wind, but it is quite easy to simulate in a step-wise fashion (like all the physics libraries do):
1) set your initial condition:
x, y, vx, vy , (for t = 0)
2) update position:
x += vx * dt, y += vy * dt , (where dt is the time elapsed since the last update)
3) calculate these velocity helpers:
vsquared = vx * vx + vy * vy and vlength = √(vsquared)
4) calculate drag force:
fdrag = c * vsquared , (where c is the coefficient of friction small!)
5) accumulate forces:
fx = (-fdrag * vx / vlength), fy = (-fdrag * vy / vlength) + (-g * mass) , (where mass is the mass of your golf ball)
6) update velocity:
vx += fx * dt / mass, vy += fy * dt / mass
That's basically Euler's Method http://en.wikipedia.org/wiki/Euler_method for approximating those physics.
EDIT
A bit more on how the simulation as requested in the comments:
- The initial condition (t = 0) in your case is
x = 0, y = 0,
vx = v0 * cos(θ),
vy = v0 * sin(θ)
It's basically the same as in your basic trajectory formula where every occurrence of t is replaced by 0.
KE = 0.5 * m * (V * V) = 0.5 * m * vsquared
is valid for every t (see vsquared as in (3)
PE = m * g * y
is also always valid.
If you want to get the current (x,y) for a given t1 what you need to do is initialize the simulation for t = 0 and do small dt updates until t = t1
If you already calculated (x,y) for a t1 and you want to know their values for a t2 where t1 < t2 all you need to do is calculating those small dt update steps from t1 to t2
Pseudo-Code:
simulate(v0, theta, t1)
dt = 0.1
x = 0
y = 0
vx = v0 * cos(theta)
vy = v0 * sin(theta)
for (t = 0; t < t1; t += dt)
x += vx * dt
y += vy * dt
v_squared = vx * vx + vy * vy
v_length = sqrt(v_squared)
f_drag = c * v_squared
f_grav = g * mass
f_x = (-f_drag * vx / v_length)
f_y = (-f_drag * vy / v_length) + (-f_grav)
v_x += f_x * dt / mass
v_y += f_y * dt / mass
end for
return x, y
end simulate