c dshlin - plots solid lines or dashed lines c c c date of first version: 21-Jun-83 c c programmer: S. Neely c c******************************************************************* subroutine dshlin(xp,yp,xn,yn,dash,space,contin) integer contin,indash real xp,yp,xn,yn,dash,space,extra,seg,dx,dy,ax,ay,x1,y1 if(.not.(contin.eq.0))goto 23000 c initialize c move call plot2(xp,yp,3) indash=1 extra=dash 23000 continue if(.not.(dash.lt.0.))goto 23002 c draw solid line c draw call plot2(xn,yn,2) goto 23003 c else 23002 continue c draw dashed line dx=xn-xp dy=yn-yp c distance between data points seg=sqrt(dx**2+dy**2) if(.not.(seg .gt. 0.))goto 23004 c draw dash patterns ax=dx/seg ay=dy/seg x1=xp y1=yp c while 23006 if(.not.(seg.ge.extra))goto 23007 c do whole dashes and spaces seg=seg-extra x1=x1+extra*ax y1=y1+extra*ay if(.not.(indash.eq.1))goto 23008 c draw call plot2(x1,y1,2) indash=0 extra=space goto 23009 c else 23008 continue c move call plot2(x1,y1,3) indash=1 extra=dash 23009 continue goto 23006 c endwhile 23007 continue c do a partial dash or space extra=extra-seg if(.not.(indash.eq.1))goto 23010 c draw call plot2(xn,yn,2) 23010 continue 23004 continue 23003 continue return end