From 138f77fe71e43adc24ecb030d73df81cc5c4eb7e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 4 Sep 2017 09:45:51 +0900 Subject: add ketpic --- .../ketlib/ketpic2escifiles6/Partitionseg.sci | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Partitionseg.sci (limited to 'texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Partitionseg.sci') diff --git a/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Partitionseg.sci b/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Partitionseg.sci new file mode 100755 index 00000000..39c23c45 --- /dev/null +++ b/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Partitionseg.sci @@ -0,0 +1,100 @@ +// 08.09.13 +// 08.10.17 +// 09.05.27 +// 09.12.31 (gsort) + +function Out=Partitionseg(varargin) + global PARTITIONPT OTHERPARTITION; + Nargs=length(varargin); + Fig=varargin(1); + GL=varargin(2); N=3; + Eps0=10^(-5); + Eps=0.05; + if Nargs>2 + Eps=varargin(3); + end; + Eps2=0.2; + if Nargs>3 + Eps2=varargin(4); + end; + if Nargs>4 + Ns=varargin(5); + Other=Mixop(Ns,OTHERPARTITION); + else + Ns=1; + Other=[]; + OTHERPARTITION=[]; + for N=1:Mixlength(GL) + OTHERPARTITION=Mixadd(OTHERPARTITION,[]); + end; + end; + Npt=size(Fig,1); + ParL=[1,Npt,Other]; + for N=Ns:Mixlength(GL) + G=Mixop(N,GL); + if Fig==G + KouL=IntersectselfPp(Fig,Eps,Eps2); + else + KouL=IntersectcrvsPp(Fig,G,Eps,Eps2); + Tmp=Nearestpt(Ptstart(Fig),G); + Tmp1=Mixop(1,Tmp); + Tmp2=Mixop(2,Tmp); + Tmp3=Mixop(3,Tmp); + if Tmp3>Eps0 & Tmp3Eps0 & Tmp3Eps + Out=[Out,Tmp]; +// P=PointonCurve(Tmp,Fig); + PARTITIONPT=Mixadd(PARTITIONPT,P); + end; + end; + if Out(length(Out))~=Npt + Out=[Out(1:length(Out)-1),Npt]; + end; + if length(Out)==1 Out=[1,Npt]; end; +endfunction; + -- cgit v1.2.3