The cosine formula should work if you apply it to the actual velocity vector itself. As you found out, it does not work on the components of that vector.
Use `sqrt(vx*vx + vy*vy)` to find the magnitude of the skier's velocity, and something like `atan2(vy, vx)` to find the skier's direction.
For the direction, you may need to swap the `vx` and `vy`, change sign, or add a constant to the result, depending on exactly how you have set up the coordinate system and how your software environment defines `atan2`. The angle will probably be given in radians, which is fine since you just need to pass it to `cos`. Try a few examples, printing out the components and the calculated angle, until you get it right.
Alternatively, you can evaluate $$ \frac d{dt} \sqrt{ (x - x_b)^2 + (y - y_b)^2 } $$ given the skier's position $(x,y)$ and velocity components $(v_x, v_y)$, taking $\frac d{dt} x = v_x$ and $\frac d{dt} y = v_y$. But I do it the first way when I program something like this.