25 real*8 a(3,3),q(4),v(3),theta,length,pi
39 if ((a(1,1)+a(2,2)+a(3,3)).gt.0.d0)
then 40 q(1)=dsqrt(a(1,1)+a(2,2)+a(3,3)+1.d0)/2.d0
41 q(2)=(a(3,2)-a(2,3))/(4.d0*q(1))
42 q(3)=(a(1,3)-a(3,1))/(4.d0*q(1))
43 q(4)=(a(2,1)-a(1,2))/(4.d0*q(1))
44 else if (((a(1,1).gt.a(2,2)).and.(a(1,1).gt.a(3,3))))
then 45 q(2)=dsqrt(a(1,1)-a(2,2)-a(3,3)+1.d0)/2.d0
46 q(1)=(a(3,2)-a(2,3))/(4.d0*q(2))
47 q(3)=(a(1,2)+a(2,1))/(4.d0*q(2))
48 q(4)=(a(1,3)+a(3,1))/(4.d0*q(2))
49 else if (a(2,2).gt.a(3,3))
then 50 q(3)=dsqrt(-a(1,1)+a(2,2)-a(3,3)+1.d0)/2.d0
51 q(1)=(a(1,3)-a(3,1))/(4.d0*q(3))
52 q(2)=(a(1,2)+a(2,1))/(4.d0*q(3))
53 q(4)=(a(2,3)+a(3,2))/(4.d0*q(3))
55 q(4)=dsqrt(-a(1,1)-a(2,2)+a(3,3)+1.d0)/2.d0
56 q(1)=(a(2,1)-a(1,2))/(4.d0*q(4))
57 q(2)=(a(1,3)+a(3,1))/(4.d0*q(4))
58 q(3)=(a(2,3)+a(3,2))/(4.d0*q(4))
61 length=dsqrt(q(2)*q(2)+q(3)*q(3)+q(4)*q(4))
75 v(1)=theta*q(2)/length
76 v(2)=theta*q(3)/length
77 v(3)=theta*q(4)/length
103 elseif(v(1).eq.0.d0)
then 104 if(v(2).lt.0.d0)
then 110 elseif(v(2).eq.0.d0)
then 111 if(v(3).lt.0.d0)
then