c c &&&&&&&&&&&&&& c c these subroutines copied from map5d c ____________________________ c c subroutine m2r(e,rodr,axis) real e(3,3),rodr(4),tmp(3),rnorm real det,detm,pi,axis(3) c c converts a MISOR matrix to Rodrigues vector c pi=4.*atan(1.) c calc. determinant c c det=e(1,1)*e(2,2)*e(3,3) c & +e(2,1)*e(3,2)*e(1,3) c & +e(3,1)*e(1,2)*e(2,3) c & -e(1,1)*e(3,2)*e(2,3) c & -e(1,2)*e(2,1)*e(3,3) c & -e(1,3)*e(2,2)*e(3,1) c if(det.lt.-0.95) det=-1.0 c if(det.gt.0.95) det=1.0 c detm=det c c we are only interested in proper vs. improper rotations here c c write(*,*) 'rotation matrixes: ',(e(ii,1),ii=1,3) c write(*,*) 'rotation matrixes: ',(e(ii,2),ii=1,3) c write(*,*) 'rotation matrixes: ',(e(ii,3),ii=1,3) c write(*,*) 'index, determinant= ',i,det c rtmp=(((e(1,1)+e(2,2)+e(3,3))/det)-1.)/2. rtmp=(((e(1,1)+e(2,2)+e(3,3)))-1.)/2. if(rtmp.lt.-1.) rtmp=-1. if(rtmp.gt.1.) rtmp=1. rodr(4)=acos(rtmp) c magnitude of rotation c tmp(1)=(e(2,3)-e(3,2))/det c tmp(2)=(e(1,3)-e(3,1))/det c tmp(3)=(e(1,2)-e(2,1))/det axis(1)=(e(2,3)-e(3,2)) axis(2)=(e(1,3)-e(3,1)) axis(3)=(e(1,2)-e(2,1)) c rnorm=sqrt(tmp(1)**2+tmp(2)**2+tmp(3)**2) rnorm=sqrt(axis(1)**2+axis(2)**2+axis(3)**2) if(rnorm.lt.1e-5) then c tmp(1)=sqrt(1.+e(1,1)) c tmp(2)=sqrt(1.+e(2,2)) c tmp(3)=sqrt(1.+e(3,3)) axis(1)=sqrt(1.+e(1,1)) axis(2)=sqrt(1.+e(2,2)) axis(3)=sqrt(1.+e(3,3)) c rnorm=sqrt(tmp(1)**2+tmp(2)**2+tmp(3)**2) rnorm=sqrt(axis(1)**2+axis(2)**2+axis(3)**2) endif c write(*,*) rnorm, tmp(1),tmp(2),tmp(3),tan(rodr(4)/2) c rodr(1)=tmp(1)/rnorm*tan(rodr(4)/2.) c rodr(2)=tmp(2)/rnorm*tan(rodr(4)/2.) c rodr(3)=tmp(3)/rnorm*tan(rodr(4)/2.) rodr(1)=axis(1)/rnorm*tan(rodr(4)/2.) rodr(2)=axis(2)/rnorm*tan(rodr(4)/2.) rodr(3)=axis(3)/rnorm*tan(rodr(4)/2.) c components of the Rodrigues vector c write(*,190) rodr(4)*180./pi c & ,rodr(1),rodr(2),rodr(3) 190 format(' angle, vector....',4f9.3) c 100 continue return end c c c ____________________________ c