This should work when x and y are not equal to 0 but it should be fairly easy to implement a solution for those cases. There is probably a more optimized way of doing what I am doing here.
I will do so when I have the time to work on the system again.
JASS:
struct MissileVector3
real x
real y
real z
//yaw
//zero safety in case of y==0 or (y==0 and x==0)
method operator angleX takes nothing returns real
local real ix = RAbsBJ(this.x)
local real iy = RAbsBJ(this.y)
return Atan(this.z/this.y)*(1-(ix/(ix+iy)))
endmethod
//pitch
//zero safety in case of x==0 or (x==0 and y==0)
method operator angleY takes nothing returns real
local real ix = RAbsBJ(this.x)
local real iy = RAbsBJ(this.y)
return -Atan(this.z/this.x)*(1-(iy/(ix+iy)))//the - is not a mistake
endmethod
//roll
method operator angleZ takes nothing returns real
return Atan2(this.y,this.x)
endmethod
endstruct