program normal * this simple code tests the derivation for normal derivative of * log| x - y | double precision x1,x2,y1,y2,th,r,pi,h,dx,dy,r1,r2 print *,'enter x1,x2,y1,y2,th,h' read *,x1,x2,y1,y2,th,h pi = 4.D0*datan(1.D0) * * method 1: r = dsqrt((x1-y1)**2+(x2-y2)**2) de1 = ((x1-y1)*dsin(th)-(x2-y2)*dcos(th))/r/r * * method 2: dx = h*dsin(th) dy = -h*dcos(th) xp = x1 + dx yp = x2 + dy xm = x1 - dx ym = x2 - dy r1 = dsqrt((xp-y1)**2+(yp-y2)**2) r2 = dsqrt((xm-y1)**2+(ym-y2)**2) de2 = 0.5D0*(dlog(r1)-dlog(r2))/h * print *,'de1=',de1,' de2=',de2 end