summaryrefslogtreecommitdiff
path: root/texmf-dist/scripts/ketcindy/ketlib/ketpicscifiles6/MakeCurves.sci
blob: f3bbd3ecce87d208cb4ca81a75fb0dca86f61e57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// 09.12.25
// 10.01.01
// 10.12.02  ( debugged for norm()==0 )

function Outdata=MakeCurves(varargin)
  Figdata=varargin(1);
  Ptout=1;
  if length(varargin)>=2
    Ptout=varargin(2);
  end
  Eps=10.0^(-6);
  IndM=Dataindex(Figdata);
  Atos=[];
  for Nd=1:size(IndM,1)
    Tmp=IndM(Nd,:);
    Motos=Figdata(Tmp(1):Tmp(2),:);
    All=size(Motos,1);
    if size(Motos,1)==1
      if InWindow(Motos)=='o'
        continue;
      end;
      if Ptout==1
        Drwpt(Motos(1,:));
      else
        Atos=[Atos;%inf,%inf;Doscaling(Motos)];
      end
      continue
    end
    Crv=[];
    for I=2:All
      P=Motos(I-1,:);
      Q=Motos(I,:);
      Snbn=MeetWindow(P,Q);
      if Snbn==[]
        if Crv~=[]
          Atos=[Atos;%inf,%inf;Doscaling(Crv)];
          Crv=[];
        end
      else
        if norm(Snbn(1,:)-Snbn(2,:))<Eps   // 10.12.02
          continue;
        end;
        if Crv==[]
          Crv=Snbn
        else
          Tmp=Crv(size(Crv,1),:);
          if norm(Tmp-Snbn(1,:))<Eps
            Crv=[Crv;Snbn(2,:)];
          else
            Atos=[Atos;%inf,%inf;Doscaling(Crv)];
            Crv=Snbn;
          end
        end
      end
    end
    if size(Crv,1)>=2
      Atos=[Atos;%inf,%inf;Doscaling(Crv)];
    end
  end
  Outdata=Atos(2:size(Atos,1),:); 
endfunction;