x is along west-east axis, x increasing from left to right
y is along north-south axis, I think y increasing from top to bottom,
but I must check this (maybe it's from bottom to top, you can easily discover
this placing a unit near the bottom border of the map and 'hint-ing' its
position)
z is along the vertical axis.
So, if you are moving north (perfectly north) at a fixed height of 100m,
velocity will return something like : [0,y,0] where y is the speed in m/s
RELATIVE to the position of the unit (so, it can be negative even if your unit is not
moving backward)
To find the direction (in the x,y) plane use ATAN2:
_unitdirection = [velocity _unit select 0] ATAN2 [velocity _unit select 1].
Be advised ATAN2 returns angles between -180/+180, but this will work
anyway with the setdir command, only you can have some problems if
you try to compares angles.
Kaliyuga: negative y value doesn't mean reverse or forward.
It's relative to the unit itself. And for the x component,
the same applies.