I am writing software (in C++) that is required to send out messages from our simulation system to another simulation system. Problem is we track the simulation object's current speed (kph) and heading (degrees) the other system needs a Velocity vector which is XYZ.
I have no idea how to do this. I unfortunately have a very weak trigonometry background and don't really understand vectors. I just need a formula to do the conversion. I could not find anything out there. Please....
So what you're looking to do from a math perspective is go from spherical coordinates to Cartesian coordinates.
Basically your velocity vector in spherical coordinates includes three pieces of information: speed, horizontal heading, and vertical heading. You want your velocity vector in terms of X,Y, and Z. To do this, we use these equations:
$x=r \, \sin\theta \, \cos\phi$
$y=r \, \sin\theta \, \sin\phi$
$z=r \, \cos\theta$
Where $r$ is your speed, $\phi$ is your horizontal bearing, and $\theta$ is your vertical bearing.
Note: you didn't actually mention that you had a vertical bearing. I'm assuming you do since you asked for an X,Y,Z vector.
There's some more information on spherical coordinates here on mathworld.