contour_lines_tracer

by

 

makes a table (X,Y,Z), contained interpolated data of same-Z points from input points massif.

inter.m
s=(C(end,3)-C(1,3))/((C(1,3)-C(end,3))^2+(C(1,2)-C(end,2))^2)^0.5;
co=(C(end,2)-C(1,2))/((C(1,3)-C(end,3))^2+(C(1,2)-C(end,2))^2)^0.5;CI=C;
CI=C;
CI(1,3)=0;
CI(1,2)=0;
CI(end,3)=0;
CI(end,2)=((C(1,2)-C(end,2))^2+(C(1,3)-C(end,3))^2)^0.5;
ci=size(CI)
for n=2:ci(1,1)-1
    CI(n,3)=(C(n,3)-C(1,3))*co-(C(n,2)-C(1,2))*s
    CI(n,2)=(C(n,2)-C(1,2))*co+(C(n,3)-C(1,3))*s
end
xi=linspace(0,CI(end,2),10);
yi=interp1(CI(:,2),CI(:,3),xi,'cubic')

for n=1:10
xj=co*xi(1,n)-yi(1,n)*s+C(1,2)
yj=C(1,3)+xi(1,n)*s+yi(1,n)*co
if n==1
CJ=[C(1,1),xj,yj];
else
CJ=[CJ;C(1,1),xj,yj];
end
end

Contact us