Setangle(70,30);
Setwindow([-1,1], [-1,1.5]);
axis=Xyzax3data('x=[0,1.2]', 'y=[0,1.2]', 'z=[0,1.2]');

phi=60*2*%pi/360;
theta=40*2*%pi/360;
A=[ cos(phi), sin(phi), 0;..
   -sin(phi), cos(phi), 0;..
           0,        0, 1];
B=[ cos(-theta), 0, sin(-theta);..
              0, 1,           0;..
   -sin(-theta), 0, cos(-theta)];
C=B*A;   
Q=[0,0,1];

Pxy=[1, 0, 0;..
     0, 1, 0;..
     0, 0, 0];

L=Spaceline([[0,0,0], Q*C]);
Lxy=Spaceline([[0,0,0], Q*C*Pxy]);
addL=Spaceline([Q*C, Q*C*Pxy]);

AG1=Anglemark([1,0], [0,0], [cos(phi), sin(phi)], 0.6);
AG2=Anglemark([cos(%pi/2-theta), sin(%pi/2-theta)], [0,0], [0,1], 0.6);

function Em1=Em1(x,y); Em1=[x,y,0]; endfunction
function Em2=Em2(x,z); Em2=[x,0,z]*A; endfunction

Angle_phi=Embed(AG1,Em1);
Angle_theta=Embed(AG2,Em2);

//Windisp(Projpara(L, Lxy, addL, axis, Angle_phi, Angle_theta));

Openfile('tex/angle_mark.tex');
Beginpicture('1.5cm');
Drwline(Projpara(L), 1.2);
Drwline(Projpara(Lxy), 0.8);
Dashline(Projpara(addL), 0.5, 0.4);
Drwline(Projpara(Angle_phi, Angle_theta), 0.5);
Drwline(Projpara(axis), 1);
Xyzaxparaname(axis, 'x', 'y', 'z');
Expr([0,-0.25], 'c', '\varphi');
Expr([0.13,0.45], 'c', '\theta');
Endpicture(0);
Closefile();
