I was trying to obtain the brachistochrone as a function of time, and I failed several times because I wrongly assumed that the $v=\sqrt{2gy}$ vector points downwards (vertical vector). However, in order to get the solution, the correct assumption was that this vector was the tangential velocity vector, the one pointing in the direction of movement through the curve (as I assumed it was instead vertical, I wrongly stated that $v_T = v \sin{(\arctan{\frac{dy}{dx}})}$). So I don't understand why it is actually $v_T=v$. I guess I had my reasons to believe $v$ was the vertical vector because $$\frac{dv}{dt}= \frac{dv}{dy} \frac{dy}{dt} = \frac{dv}{dy} v_y = g \Rightarrow \\ v_y dv = g \cdot dy, v_{y_0} = 0, y_0=0 \Rightarrow \frac{1}{2} v_y^2 = gy \Rightarrow v_y=\sqrt{2gy}$$ and you also get to $v=\sqrt{2gy}$ by conservation of energy. So that's why I assumed $v=v_y$. As I said, this should be wrong. Can someone then explain why is $v$ the tangential velocity so that $v^2 = v_x^2 + v_y^2 , v_x \neq 0$?
Edit: Thanks for the answers. Both helped me. If anyone is interested I'll write my conclusions here. So first I was told that the velocity is always pointing towards the direction of motion, so it makes sense for it to be tangential to the curve. But this made me wonder what I did wrong in my calculations. It was indeed wrong as someone stated that the force applied was not vertical. The force I have to consider is $mg \sin{\alpha}$, where $\alpha= \arctan{\frac{dy}{dx}}$, so this sine becomes $\frac{dy}{\sqrt{dx^2 + dy^2}}= \frac{dy}{ds}$, where s is the arc length. Then, by Newton's second law, $$m \frac{dv}{dt} = m \frac{dv}{ds} \frac{ds}{dt} = m \frac{dv}{ds} v = mg \frac{dy}{ds} \Rightarrow v \cdot dv = g \cdot dy \Rightarrow \\ \Rightarrow \dots \Rightarrow v= \sqrt{2gy}$$ And we got the same result as from energy-conservation. This one made it clear for me that this was indeed the tangential velocity, as I used the $\frac{ds}{dt}$ definition.