tic
x=[3 4 .1];

pt=.1
rl=.05
hd=pi/3

a_ct=cos(pt);
a_st=sin(pt);
a_cp=cos(rl);
a_sp=sin(rl);
a_cs=cos(hd);
a_ss=sin(hd);

t(1,1)=a_cs*a_ct;
t(1,2)=a_ss*a_cp-a_cs*a_st*a_sp;
t(1,3)=a_ss*a_sp-a_cs*a_st*a_cp;
t(2,1)=-a_ss*a_ct;
t(2,2)=a_cs*a_cp+a_ss*a_st*a_sp;
t(2,3)=-a_cs*a_sp+a_ss*s_st*a_cp;
t(3,1)=a_st;
t(3,2)=a_ct*a_sp;
t(3,3)=a_ct*a_cp;

y=t*x;
toc
