eepgoing
0083         dx=diff(x([ipt(i),ipt(i+1)]));
0084         dy=diff(y([ipt(i),ipt(i+1)]));
0085         datadxy=[dx,dy];
0086         [~,direction]=max(abs([dx,dy]));
0087         data=circshift([x([ipt(i),ipt(i+1)]),y([ipt(i),ipt(i+1)])],[0,direction-1]);
0088         datadxy= circshift(  datadxy,[0,direction-1]);
0089         dataXI=data(1,1):datadxy(1)/dI:data(<span class="keyword">end</span>,1);
0090         dataYI = interp1(data(:,1),data(:,2),dataXI);
0091         dataI=circshift([dataXI(:),data