This:
(12.0+tan(alpha)*(xpos-33.0)) + R_ball/cos(alpha)
Is a line of an inclined surface.
If the y position of the ball is < or = this line then:
add this to the x velocity component:
v*costheta*cosphi
and this to the y component:
v*costheta*sinphi
phi is the angle for a line perpendicular to the inclined surface, counted counter-clockwise, starting at zero at the horizontal plane.
theta is the angle of the incoming projectile measured from that line perpenicular to the inclined surface.
I kinda hoped the details weren't necessary, that someone simply recognised the problem and could come with a fast and easy solution
. That's why I didn't post any more.