%%Funçao para o calculo dos angulos de Euler

function AE=AngEuler(M)

    x=M(1,4);
    y=M(2,4);
    z=M(3,4);
    f=180*atan2(M(2,1),M(1,1))/pi;    %%atan2(ny,nx)
    t=180*atan2(-M(3,1),M(1,1)*cos(f)+M(2,1)*sin(f))/pi;  %%atan2(-nz,nxcos(f)+nysen(f))
    p=180*atan2(M(3,2),M(3,3))/pi;    %%atan2(sz,az)

AE=[x y z f t p];  %%fi teta psi