summaryrefslogtreecommitdiff
path: root/texmf-dist/scripts/ketcindy/ketlib/ketpicscifiles6/Intersectcrvsf.sci
blob: 2a2e5b6c590882b357f1ec1612e379bd09494248 (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
// 08.10.26
// 10.02.16

function Out=Intersectcrvsf(varargin)
  Nargs=length(varargin);
  Eps0=10^(-4);
  Crv=varargin(1);
  Fd=varargin(2);
  N=3;Uveq=1;
  if Nargs>=3
    Tmp=varargin(3);
    if type(Tmp)==10
      Uveq=Tmp;
      N=4;
    end;
  end;
  Np=[50,50];
  if Nargs>=N
    Np=varargin(N);
    if length(Np)==1
      Np=[Np,Np];
    end;
  end;
  Eps=[0.05,1]; //
  if Nargs>=N+1
    Eps=varargin(N+1);
  end;
  if length(Eps)==1 //
    Eps=[Eps,1]; //
  end; //
  Out=[];
  for I=1:Numptcrv(Crv)-1
    PtA=Ptcrv(I,Crv);
    PtB=Ptcrv(I+1,Crv);
    if norm(PtB-PtA)<Eps0
      continue;
    end;
    PL=Meetpoints(PtA,PtB,Fd,Uveq,Np,Eps(1));
    for J=1:Mixlength(PL)
      Pt=Mixop(J,PL);
      Tmp=norm(Pt-PtA)/norm(PtB-PtA);
      Tmp=min(max(Tmp,0),1);
      Out=Mixadd(Out,[Pt,I+Tmp]);
    end;
  end;
endfunction;