function [psi1, theta1, phi1] = getAngle(Infr,Supr)
% (psi1,theta1,phi1)

%[d,B1,tr] = procrustes(Supr,Infr,'scaling',false,'reflection',false);
%[d,B1,tr] = procrustes(Infr',Supr','scaling',false,'reflection',false);
%T = tr.T;
% T=theta1 = asind(-T(3,1));
% % theta2 = -asin(T(3,1));
% 
% psi1 = atan2d(T(2,1)/cos(theta1),T(1,1)/cos(theta1));
% % psi2 = atan2(T(2,1)/cos(theta2),T(1,1)/cos(theta2));
% phi1 = atan2d(T(3,2)/cos(theta1),T(3,3)/cos(theta1));
% % phi2 = atan2(T(3,2)/cos(theta2),T(3,3)/cos(theta2));

T=Supr'*inv(Infr');
%T=Infr'*inv(Supr');
phi1=asind(T(2,1));
theta1=asind(T(3,1)/(-cosd(phi1)));
psi1=asind(T(2,3)/(-cosd(phi1)));

end
%changed all arc trig functions to trigfxnd to get degrees 9/26/13 DB
% if psi1>90
%     psi1=psi1-180;
% elseif psi1<-90
%     psi1=psi1+180;
% end
% if theta1>90
%     theta1=theta1-180;
% elseif theta1<-90
%     theta1=theta1+180;
% end
% if phi1>90
%     phi1=phi1-180;
% elseif phi1<-90
%     phi1=phi1+180;
% end