# Calculate velocity vector given position on sphere, heading, and pitch

I would like to simulate a satellite's orbit iteratively using Cartesian coordinates. I am using the center of the earth for $(0, 0, 0).$ Given a heading, pitch, magnitude, and initial position, I want to compute the velocity vector.

Given that:

$$\begin{eqnarray} \mbox{radius} &=& \sqrt{x^2 + y^2 + z^2}\\ \mbox{latitude} &=& \arccos(z / \mbox{radius})\\ \mbox{longitude} &=& \arctan(y / x) \end{eqnarray}$$

For my polar coordinates, I assume the equator has latitude of $\pi/2,$ and the north pole is latitude $0.$

Right now I have unit velocity vector set with these equations, however they assume heading is $0$ and pitch is $0$ (I hope):

$$\begin{eqnarray} V_x &=& -\cos(\mbox{latitude}) \cdot \cos(\mbox{longitude})\\ V_y &=& -\cos(\mbox{latitude}) \cdot \sin(\mbox{longitude})\\ V_z &=& \sin(\mbox{latitude}) \end{eqnarray}$$

Is this part correct? If so, what do I need to add to these equations to account for heading and pitch? My heading notation would be $0$ for pointing north, $\pi$ for pointing south, $\pi/2$ east, $3\pi/2$ for west. For pitch, my notation assumes $0$ means flat, $\pi/2$ straight up, $-\pi/2$ straight down (with respect to the normal plane of the surface of the sphere).