diff options
Diffstat (limited to 'texmf-dist/scripts/ketcindy/ketlib/ketpic2escifiles6/Partcrv.sci')
-rw-r--r-- | texmf-dist/scripts/ketcindy/ketlib/ketpic2escifiles6/Partcrv.sci | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/texmf-dist/scripts/ketcindy/ketlib/ketpic2escifiles6/Partcrv.sci b/texmf-dist/scripts/ketcindy/ketlib/ketpic2escifiles6/Partcrv.sci new file mode 100644 index 00000000..0b4844df --- /dev/null +++ b/texmf-dist/scripts/ketcindy/ketlib/ketpic2escifiles6/Partcrv.sci @@ -0,0 +1,42 @@ +// 08.05.31 +// 09.03.06 + +function Ans=Partcrv(A,B,PkL) + Eps=10.0^(-3); + if type(A)==1 & length(A)==1 + // new part from + if A>B+Eps + Npt=Numptcrv(PkL); + Out1=Partcrv(A,Npt,PkL); + Out2=Partcrv(1,B,PkL); + Tmp=Ptstart(PkL)-Ptend(PkL); + if norm(Tmp)<Eps + Ans=Joincrvs(Out1,Out2); + else + Ans=Mix(Out1,Out2); + end; + return; + end; + // to here + Is=ceil(A); + Ie=floor(B); + PL=[]; + if A<Is-Eps + P=(Is-A)*PkL(Is-1,:)+(1-Is+A)*PkL(Is,:); + PL=[P]; + end + PL=[PL;PkL(Is:Ie,:)]; + if B>Ie+Eps + P=(1-B+Ie)*PkL(Ie,:)+(B-Ie)*PkL(Ie+1,:); + PL=[PL;P] + end + Ans=PL; + return + end; + Tmp=Nearestpt(A,PkL);// + Ta=Op(2,Tmp);// + Tmp=Nearestpt(B,PkL);// + Tb=Op(2,Tmp);// + Ans=Partcrv(Ta,Tb,PkL);// +endfunction; + |