1 subroutine odlodc(r1,r2,a,b,uu,vv,aa,bb,dd)
2 implicit real*8 (a-h,o-z)
3 dimension r1(3),r2(3),a(3),b(3),x(3),y(3)
4 odl(u,v) = (r1(1)-r2(1))**2+(r1(2)-r2(2))**2+(r1(3)-r2(3))**2
5 & + 2*ar*u - 2*br*v - 2*ab*u*v + aa*u**2 + bb*v**2
6 c print *,"r1",(r1(i),i=1,3)
7 c print *,"r2",(r2(i),i=1,3)
8 c print *,"a",(a(i),i=1,3)
9 c print *,"b",(b(i),i=1,3)
10 aa = a(1)**2+a(2)**2+a(3)**2
11 bb = b(1)**2+b(2)**2+b(3)**2
12 ab = a(1)*b(1)+a(2)*b(2)+a(3)*b(3)
13 ar = a(1)*(r1(1)-r2(1))+a(2)*(r1(2)-r2(2))+a(3)*(r1(3)-r2(3))
14 br = b(1)*(r1(1)-r2(1))+b(2)*(r1(2)-r2(2))+b(3)*(r1(3)-r2(3))
16 c print *,'aa',aa,' bb',bb,' ab',ab,' ar',ar,' br',br,' det',det
17 uu = (-ar*bb+br*ab)/det
18 vv = (br*aa-ar*ab)/det
25 dd2 = odl(0.0d0,0.0d0)
26 dd3 = odl(0.0d0,1.0d0)
27 dd4 = odl(1.0d0,0.0d0)
28 dd5 = odl(1.0d0,1.0d0)
29 dd = dsqrt(dmin1(dd1,dd2,dd3,dd4,dd5))
33 else if (dd.eq.dd3) then
36 else if (dd.eq.dd4) then
39 else if (dd.eq.dd5) then
48 c dd1 = (x(1)-y(1))**2+(x(2)-y(2))**2+(x(3)-y(3))**2
52 c write (8,*) uu,vv,dd,dd1