summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs')
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs511
1 files changed, 214 insertions, 297 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
index c1e21281ede..5f65ad6c50d 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
@@ -14,7 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindylibbasic2[20190531] loaded");
+println("ketcindylibbasic2[20190921] loaded");
//help:start();
@@ -28,9 +28,9 @@ Drwfigs(nm,figlist,optionlist,commonops):=Drawfigures(nm,figlist,optionlist,comm
Drawfigures(nm,figlist):=Drawfigures(nm,figlist,[]);
Drawfigures(nm,figlist,optionlist):=Drawfigures(nm,figlist,optionlist,[]);
Drawfigures(nm,figlistorg,optionlistorg,commonops):=(
-//help:Drawfigures(["pt1","cr1"], [["Size=3"],[]],["Msg=n"]);
+//help:Drawfigures("1",["pt1","cr1"], [["Size=3"],[]],["Msg=n"]);
+//help:Drawfigures("","re1",[["Size=3"],[]],["Msg=n"]);
regional(figlist,name,figL,optionlist,nn,kk,fig,eqL,msg,tmp,tmp1,tmp2);
- name="figs"+nm;
tmp=Divoptions(commonops);
eqL=tmp_5;
msg="Y";
@@ -42,7 +42,12 @@ Drawfigures(nm,figlistorg,optionlistorg,commonops):=(
);
);
figlist=figlistorg;
- if(isstring(figlist),figlist=parse(figlist));
+ if(isstring(figlist), //190818from
+ name=figlist+nm;
+ figlist=parse(figlist);
+ ,
+ name="figs"+nm;
+ ); //190818to
nn=length(figlist);
optionlist=optionlistorg;
if(length(optionlist)==0, //190531from
@@ -62,26 +67,40 @@ Drawfigures(nm,figlistorg,optionlistorg,commonops):=(
fig=figlist_kk;
if(isstring(fig),fig=parse(fig));
if(length(fig)>0,
- if(Measuredepth(fig)==0,fig=[fig]); //190531from
- if(Measuredepth(fig)==1,fig=[fig]);
- forall(1..(length(fig)),
- tmp1=fig_#;
- tmp2=name+"n"+text(kk)+"p"+text(#);
- if(length(tmp1)==1,
- Pointdata(tmp2,tmp1,optionlist_kk);
- figL=append(figL,"pt"+tmp2);
+ if(isstring(figlistorg),
+ tmp1=Measuredepth(fig);
+ tmp2=append(optionlist_kk,"Msg=n");
+ tmp=fig;
+ if(tmp1==2,tmp=tmp_1);
+ if(length(tmp)>1,
+ Listplot("-"+name+"n"+text(kk),fig,tmp2);
,
- Listplot("-"+tmp2,tmp1,optionlist_kk);
- figL=append(figL,tmp2); //190427
+ if(tmp1==2,fig=apply(fig,#_1));
+ Pointdata("-"+name+"n"+text(kk),fig,tmp2);
);
- ); //190531to
+ figL=append(figL,name+"n"+text(kk));
+ ,
+ if(Measuredepth(fig)==0,fig=[fig]); //190531from
+ if(Measuredepth(fig)==1,fig=[fig]);
+ forall(1..(length(fig)),
+ tmp1=fig_#;
+ tmp2=name+"n"+text(kk)+"p"+text(#);
+ if(length(tmp1)==1,
+ Pointdata(tmp2,tmp1,optionlist_kk);
+ figL=append(figL,"pt"+tmp2);
+ ,
+ Listplot("-"+tmp2,tmp1,optionlist_kk);
+ figL=append(figL,tmp2); //190427
+ );
+ ); //190531to
+ tmp=apply(figL,Dqq(#));
+ tmp=name+"="+text(tmp)+";";
+ parse(tmp);
+ );
+ );
+ if(msg=="Y",
+ println("generate "+name+"="+text(figL));
);
- );
- tmp=apply(figL,Dqq(#));
- tmp=name+"="+text(tmp)+";";
- parse(tmp);
- if(msg=="Y",
- println("generate "+name+"="+text(figL));
);
figL;
);
@@ -280,7 +299,7 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from
tmp=name+"="+Textformat(tmp1,5)+";"; //190415
parse(tmp);
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
Listplot("-arh"+nm,apply(list,LLcrd(#)),concat(options,["notex","Msg=n"]));
);
@@ -310,12 +329,18 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from
);
////%Arrowhead end////
-////%Arrowdata start////
-Arrowdata(ptlist):=Arrowdata(ptlist,[]); //181110from
-Arrowdata(Arg1,Arg2):=(
+////%Arrowdata start//// 190727 (<= Lightarrowdata)
+Arrowdata(ptlist):=Lightarrowdata(ptlist,[]);
+Arrowdata(Arg1,Arg2):=Lightarrowdata(Arg1,Arg2);
+Arrowdata(nm,ptlistorg,optionsorg):=Lightarrowdata(nm,ptlistorg,optionsorg);
+////%Arrowdata end////
+
+////%OldArrowdata start////
+Arrowdata(ptlist):=OldArrowdata(ptlist,[]); //181110from
+OldArrowdata(Arg1,Arg2):=(
regional(name);
if(isstring(Arg1),
- Arrowdata(Arg1,Arg2,[]);
+ OldArrowdata(Arg1,Arg2,[]);
,
name="";
forall(Arg1,
@@ -323,14 +348,14 @@ Arrowdata(Arg1,Arg2):=(
name=name+#.name; //190505
);
);
- Arrowdata(name,Arg1,Arg2);
+ OldArrowdata(name,Arg1,Arg2);
);
); //181110from
-Arrowdata(nm,ptlistorg,optionsorg):=(
-//help:Arrowdata("1",[A,B]);
-//help:Arrowdata("1",[pt1,pt2]);
-//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]);
-//help:Arrowdata(optionsadded=["line"]);
+OldArrowdata(nm,ptlistorg,optionsorg):=(
+// help:Arrowdata("1",[A,B]);
+// help:Arrowdata("1",[pt1,pt2]);
+// help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]);
+// help:Arrowdata(optionsadded=["line"]);
regional(options,Ltype,Noflg,name,opstr,opcindy,eqL,reL,strL,color,size,coord,
flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos,cut,scaley,ptlist);
name="ar"+nm;
@@ -426,7 +451,7 @@ Arrowdata(nm,ptlistorg,optionsorg):=(
Setscaling(scaley); //190412
[Lcrd(pA),Lcrd(pB)];
);
-////%Arrowdata end////
+////%OldArrowdata end////
////%Lightarrowdata start////
Lightarrowdata(ptlist):=Lightarrowdata(ptlist,[]); //181110from
@@ -445,8 +470,8 @@ Lightarrowdata(Arg1,Arg2):=(
);
); //181110from
Lightarrowdata(nm,ptlist,optionsorg):=(
-//help:Lightarrowdata("1",[pt1,pt2]);
-//help:Lightarrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Line=y(n)"]);
+//help:Arrowdata("1",[pt1,pt2]);
+//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Line=y(n)"]);
regional(options,Ltype,Noflg,opstr,opcindy,eqL,reL,strL,color,size,coord,lineflg,
flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos,cut,scaley,Ev,Nv,pP);
pA=Pcrd(ptlist_1); pB=Pcrd(ptlist_2);
@@ -510,7 +535,7 @@ Lightarrowdata(nm,ptlist,optionsorg):=(
tmp="ar"+nm+"="+Textformat([pA,pB],5)+";";
parse(tmp);
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if(lineflg==1, //190504from
Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],append(options,"Msg=n"));
@@ -532,10 +557,16 @@ Lightarrowdata(nm,ptlist,optionsorg):=(
Texcom("{");Com2nd("Setcolor("+color+")");//180722
); //no ketjs off
Setscaling(scaley);
- tmp1=Textformat(LLcrd(pP),5);
+ tmp1=Textformat(LLcrd(pP),5); //no ketjs on
tmp2=Textformat(LLcrd(pB-pA),5);
+ if(cut>0, //190727from //no ketjs on
+ tmp=Indexall(opstr,",");
+ tmp=tmp_(length(tmp));
+ opstr=substring(opstr,0,tmp-1);
+ opstr=opstr+","+Dqq("Cut="+text(cut));
+ ); //190727to
Com2nd("Arrowhead("+tmp1+","+tmp2+opstr+")");
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
+ if((Noflg==0)&(color!=KCOLOR), //180904
Texcom("}");//180722
); //no ketjs off
,
@@ -665,7 +696,7 @@ Anglemark(nm,plist,options):=(
tmp=name+"=Anglemark("+tmp1+opstr+")";
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -780,7 +811,7 @@ Paramark(nm,plist,options):=(
tmp=name+"=Paramark("+tmp1+opstr+")";
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -959,7 +990,7 @@ Bowdata(nm,plist,options):=(
);
if(Noflg<3,
if(Msg=="Y", //190206
- println("generate bowdata "+name+" and "+Bpos);//16.10.31
+ println("generate bowdata "+name+" and BOWMIDDLE="+Bpos);//16.10.31,190704
);
if(Measuredepth(Out)==1,Out=[Out]);
tmp1=[];
@@ -973,7 +1004,7 @@ Bowdata(nm,plist,options):=(
tmp=name+"=Bowdata("+tmp1+opstr+")";
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -1208,7 +1239,7 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06
tmp=RSform(tmp);
GLIST=append(GLIST,tmp);
); //no ketjs off
- if((nn>0)&(Noflg<2), //190211
+ if((nn>0)&(Noflg<3), //190211
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -1225,170 +1256,6 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06
);
////%Deqplot end////
-////////// old enclosing ///////////////
-
-Enclosing(nm,plist):=EnclosingS(nm,plist);
-Enclosing(nm,plist,options):=EnclosingS(nm,plist,options);
-EnclosingS(nm,plist):=EnclosingS(nm,plist,[]);
-EnclosingS(nm,plist,options):=(
-// help:Enclosing("1",["sc2","crAB","sc2","Invert(sc1)"],[pt,"dr"]);
- regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt,color
- t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy);
- name="en"+nm;
- tmp=Divoptions(options);
- Ltype=tmp_1;
- Noflg=tmp_2;
- eqL=tmp_5;
- realL=tmp_6;
- color=tmp_(length(tmp)-2);
- opstr=tmp_(length(tmp)-1);
- opcindy=tmp_(length(tmp));
- Eps=10^(-5); // 16.12.05
- EEps=0.05;
- Start=[];
- Flg=0;
- forall(realL,
- if(islist(#) % ispoint(#),
- Start=Lcrd(#); // 15.09.12
- ,
- Flg=Flg+1;
- if(Flg==1,Eps=#);
- if(Flg==2,EEps=#);
- );
- );
-// tmp1=concat([Eps,EEps],eqL); // 15.04.06
- Fdata=plist_1;
- Gdata=plist_(length(plist));
- KL=Intersectcrvspp(Fdata,Gdata);
- if(length(KL)==1,
- pt=KL_1_1;
- t1=KL_1_2;
- );
- if(length(KL)==0,
- if(Numptcrv(Fdata)>Numptcrv(Gdata),
- tmp=Nearestpt(Fdata,Gdata);
- pt=tmp_1;
- t1=tmp_2;
- ,
- tmp=Nearestpt(Gdata,Fdata);
- pt=tmp_3;
- t1=tmp_4;
- );
- );
- if(length(KL)>1,
- if(Start==[],
- err("No Start Point");
- ,
- pt=KL_1_1;
- t1=KL_1_2;
- tmp=Norm(pt-Start);
- forall(2..(length(KL)),ii, // 15.04.20
- tmp1=KL_ii_1;
- tmp2=Norm(tmp1-Start); // 15.04.20
- if(tmp2<tmp,
- pt=tmp1;
- t1=KL_ii_2;
- tmp=tmp2;
- );
- );
- );
- );
-// pt=Pcrd(pt); // 15.09.12
- Start=pt;
- AnsL=[];
- forall(1..(length(plist)),nn,
- Fdata=plist_nn;
- if(nn>1, pt=qt);
- if(nn==length(plist),
- qt=Start;
- ,
- Flg=0;
- Gdata=plist_(nn+1);
-// tmp1=concat([Eps,EEps],eqL); // 15.04.06
- KL=Intersectcrvspp(Gdata,Fdata);
- if(length(KL)==1,
- tmp=KL_1;
- qt=KL_1_1;
- t3=KL_1_2;
- Flg=10;
- );
- if(length(KL)==0,Flg=1);
- if(length(KL)>1,
- tmp1=KL_1_1;
- tmp2=KL_2_1;
- tmp=|tmp1-tmp2|;
- if(tmp<Eps*10, Flg=1);
- );
- if(Flg==1,
- if(Numptcrv(Fdata)>Numptcrv(Gdata),
- tmp=Nearestpt(Fdata,Gdata);
- qt=tmp_1;
- t3=tmp_4;
- Flg=10;
- ,
- tmp=Nearestpt(Gdata,Fdata);
- qt=tmp_3;
- t3=tmp_2;
- Flg=10;
- );
- );
- if(Flg<10,
- t2=10^6; //%inf;
- forall(1..(length(KL)),ii,
- tmp1=KL_ii_1;
- tmp=KL_ii_3;
- tmp2=Paramoncurve(tmp1,tmp,Fdata);
- tmp3=KL_ii_2;
- if(tmp2>t1+Eps & tmp2<t2+Eps,
- qt=tmp1;
- t2=tmp2;
- t3=tmp3;
- );
- );
- );
- );
- tmp=Partcrv("",pt,qt,Fdata,["nodata"]);
- t1=t3;
- if(nn==1,
- AnsL=tmp;
- ,
- AnsL=concat(AnsL,tmp_(2..(length(tmp))));
- );
- );
- AnsL=apply(AnsL,Pcrd(#)); // 15.09.12
- AnsL_(length(AnsL))=AnsL_1;//16.10.20
- if(Noflg<3,
- println("generate Enclosing "+name);
- tmp=name+"="+Textformat(AnsL,5)+";";
- parse(tmp);
- tmp=name+"=Enclosing(";//16.11.07from //no ketjs on
- tmp1="list"+PaO();
- forall(plist,
- tmp1=tmp1+#+",";
- );
- tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")";
- GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off
- );
- if(Noflg<2,
- if(isstring(Ltype),
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
- Texcom("{");Com2nd("Setcolor("+color+")");//180722
- ); //no ketjs off
- Ltype=Getlinestyle(text(Noflg)+Ltype,name);
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
- Texcom("}");//180722
- ); //no ketjs off
- ,
- if(Noflg==1,Ltype=0);
- );
- GCLIST=append(GCLIST,[name,Ltype,opcindy]);
- );
- tmp=apply(AnsL,LLcrd(#));//16.10.20
- tmp;
-);
-
-/////////// new enclosing ///////////
-
////%Enclosing start////
Enclosing(nm,plist):=Enclosing2(nm,plist,[]);//180706[2lines]
Enclosing(nm,plistorg,options):=Enclosing2(nm,plistorg,options);
@@ -1398,7 +1265,7 @@ Enclosing2(nm,plistorg,options):=(
//help:Enclosing(options=[startpoint,epspara(1)]);
regional(name,plist,AnsL,Start,Eps,Eps1,Eps2,flg,Fdata,Gdata,KL,
t1,t2,tst,ss,ii,nn,nxtno,Ltype,Noflg,realL,eqL,opstr,opcindy,
- tmp,tmp1,tmp2,color,epspara,p1,p2);
+ tmp,tmp1,tmp2,color,p1,p2);
name="en"+nm;
plist=plistorg;
tmp=Divoptions(options);
@@ -1410,7 +1277,6 @@ Enclosing2(nm,plistorg,options):=(
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Eps=10^(-5); // 16.12.05
- epspara=1; //180707
Eps1=0.01;
Eps2=0.1;
Start=[];
@@ -1419,7 +1285,6 @@ Enclosing2(nm,plistorg,options):=(
if(isList(#) % ispoint(#),
Start=Lcrd(#); // 18.02.02
,
- if(flg==0,epspara=#);//180707
if(flg==1,Eps1=#);
if(flg==2,Eps2=#);
flg=flg+1;
@@ -1496,8 +1361,7 @@ Enclosing2(nm,plistorg,options):=(
,
KL=sort(KL,[#_2]);//180706
tmp=parse(Fdata);
- tmp1=t1+epspara/50*length(tmp);
-// KL=select(KL,#_2>t1+epspara/50*length(tmp)); //180707
+ tmp1=t1+Eps;
KL=select(KL,(#_2>tmp1)%((#_2>t1)&(|#_1-p1|>Eps1))); //180713,16
t2=KL_1_2;
ss=KL_1_3;
@@ -1537,10 +1401,10 @@ Enclosing2(nm,plistorg,options):=(
);
tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")";//18.0706from //no ketjs on
if(length(Start)>0,tmp=tmp+","+Textformat(Start,6));
- tmp=tmp+","+text(epspara)+")";//18.0706to,180707
+ tmp=tmp+","+text(Eps1)+")";//18.0706to,180707
GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -1559,8 +1423,6 @@ Enclosing2(nm,plistorg,options):=(
);
////%Enclosing end////
-/////////// end of new enclosing ///////////
-
/////////// new Hatchdata(cindy) ///////////
////%Makehatch start////
@@ -1947,7 +1809,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=(
GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102 //no ketjs
);
);
- if((Noflg<2)&(mkflg>-1),
+ if((Noflg<3)&(mkflg>-1), //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -2349,7 +2211,7 @@ Rotatedata(nm,plist,angle,optionorg):=(
+Textformat(angle,5)+","+RSform(Textformat(Pt,5))+")"; //17.12.23
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -2431,7 +2293,7 @@ Translatedata(nm,plist,mov,optionorg):=(
tmp=name+"=Translatedata("+tmp1+","+RSform(Textformat(mov,5))+")";
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -2537,7 +2399,7 @@ Scaledata(nm,plist,rx,ry,optionorg):=(
+Textformat(rx,5)+","+Textformat(ry,5)+","+RSform(Textformat(Pt,5))+")";
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -2635,7 +2497,7 @@ Reflectdata(nm,plist,symL,optionorg):=(
tmp=name+"=Reflectdata("+tmp1+","+RSform(Textformat(symL,5))+")";//17.12.23
GLIST=append(GLIST,tmp); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -2798,38 +2660,48 @@ Htick(px,lenorg,options):=(
////%Htick end////
////%Setax start////
-Setax(arglist):=(
-//help:Setax(["l","x","e","y","n","O","sw"]);
+Setax(arglistorg):=(
+//help:Setax(["l","x","e","y","n","O","sw","Size=1.5"]);
//help:Setax([7,"nw"]);
//help:Setax([8,linestyle,colorax,colorlabel]);
- regional(st,nn,tmp); //181215from
- st=1; nn=1;
+ regional(arglist,st,nn,tmp,eqL);
+ tmp=Divoptions(arglistorg); //190901from
+ eqL=tmp_5;
+ arglist=remove(arglistorg,eqL);
+ if(length(arglist)==0,
+ arglist=["l","x","e","y","n","O","sw"];
+ ); //190901to
+ st=1; nn=1;
if(isreal(arglist_1),
st=2;
nn=arglist_1;
);
forall(st..(length(arglist)),
tmp=arglist_#;
- if(length(tmp)>0,AXSTYLE_nn=tmp);
+ if(length(tmp)>0,AXSTYLE_1_nn=tmp);
nn=nn+1;
- ); //181215from
+ );
+ AXSTYLE=[AXSTYLE_1,eqL]; //190901,02
// tmp=MakeRarg(arglist);
// Com1st("Setax("+tmp+")");
);
////%Setax end////
////%Drwxy start////
-Drwxy():=Drwxy(0,[]); //190103from
-Drwxy(Arg):=(
- if(islist(Arg),Drwxy(0,Arg); Drwxy(Arg,[]));
+Drwxy():=Drwxy(0,[]);
+Drwxy(Arg):=( //190901from
+ if(islist(Arg),
+ Drwxy(0,Arg);
+ ,
+ Drwxy(Arg,[]);
+ ); //190901to
);
-Drwxy(add):=Drwxy(add,[]);
-Drwxy(add,optionsorg):=( //190103to
+Drwxy(add,optionsorg):=(
//help:Drwxy();
//help:Drwxy(1[the last axis will be drawn],oprions);
//help:Drwxy(options);
-//help:Drwxy(options=["Xrng=","Yrng=","Ax=l,x,e,..."]);
- regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size,
+//help:Drwxy(options=["Xrng=","Yrng=","Ax=l,x,e,...","Size="]);
+ regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size,labelsize,
linesty,colorax,colorla,tmp,tmp1,tmp2);
options=optionsorg;
tmp=Divoptions(options);
@@ -2842,7 +2714,16 @@ Drwxy(add,optionsorg):=( //190103to
//tmp1=max([org_2+YMIN,YMIN]);
//tmp2=min([org_2+YMAX,YMAX]);
yrng=[YMIN,YMAX]; //190103
- ax=AXSTYLE;
+ ax=AXSTYLE_1; //190901from
+ labelsize="Size=1";
+ forall(AXSTYLE_2,
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
+ if(contains(["S","L"],tmp1),
+ labelsize="Size="+tmp_2;
+ options=remove(options,[#]);
+ );
+ ); //190901to
linesty=ax_8;
if(length(ax_9)>0, //190427
if(isstring(ax_9),colorax=ax_9,colorax=text(ax_9));
@@ -2859,8 +2740,6 @@ Drwxy(add,optionsorg):=( //190103to
);
); //181217to
forall(eqL,
- tmp=Strsplit(#,"=");
- tmp1=Toupper(substring(tmp_1,0,1));
if(tmp1=="O", //190103from
org=parse(tmp_2);
options=remove(options,[#]);
@@ -2908,9 +2787,10 @@ Drwxy(add,optionsorg):=( //190103to
Listplot("-axy"+text(AXCOUNT),tmp,tmp1);
);
AXCOUNT=AXCOUNT+1;
- Expr([[xrng_2,org_2],ax_3,ax_2],[colorla]);//181216[3lines]
- Expr([[org_1,yrng_2],ax_5,ax_4],[colorla]);
- Letter([org,ax_7,ax_6],[colorla]);
+ tmp=[colorla,labelsize]; //190901from
+ Expr([[xrng_2,org_2],ax_3,ax_2],tmp);
+ Expr([[org_1,yrng_2],ax_5,ax_4],tmp);
+ Letter([org,ax_7,ax_6],tmp); //190901to
if(add==0, //190103
Addax(0);
);
@@ -3025,6 +2905,7 @@ Letter(list,options):=(
Off=-4;
Dmv=8;
Nj=1;
+// if(Ketcindyjsfigure>0,sz=round(sz*Ketcindyjsscale) ); // only ketjs
while(Nj+2<=length(list),
Pos=list_Nj;
Dir=list_(Nj+1);
@@ -3077,6 +2958,11 @@ Letter(list,options):=(
if(Ymv==0,Ymv=-4);//16.10.08
aln="mid"; // 16.09.30until
);
+// if(Ketcindyjsfigure>0, // only ketjs on
+// Off=round(Off*Ketcindyjsscale);
+// Xmv=round(Xmv*Ketcindyjsscale);
+// Ymv=round(Ymv*Ketcindyjsscale);
+// ); // only ketjs off
Str=list_(Nj+2); //17.10.17
drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv],
size->sz,color->color,align->aln,bold->bld,italics->ita);//16.10.09
@@ -3179,54 +3065,102 @@ Exprrot(pt,dir,tmov,nmov,str,options):=(
);
////%Exprrot end////
+////%Ptpos start//// 190906
+Ptpos(pt):=Ptpos(pt,[]);
+Ptpos(ptorg,pos):=(
+//help:Ptpos(A);
+//help:Ptpos(A, [3,2]);
+ regional(pt,out,tmp);
+ if(ispoint(ptorg),pt=ptorg,pt=parse(ptorg));
+ if(length(pos)==0,
+ tmp=pt.name+"position";
+ out=parse(tmp);
+ if(!islist(out),
+ tmp=tmp+"="+Textformat(pt.xy,6)+";";
+ parse(tmp);
+ );
+ ,
+ pt.xy=pos;
+ tmp=pt.name+"position="+Textformat(pt.xy,6)+";";
+ parse(tmp);
+ out=pt.xy;
+ );
+ out;
+);
+////%Ptpos end////
+
+////%Strictmove start////
+Strictmove(pC):=Strictmove(pC,StrictSep); //190831
+Strictmove(pCorg,sep):=(
+ regional(pC,tmp,tmp1,tmp2);
+ pC=pCorg;
+ if(ispoint(pC),pC=pC.name);
+ tmp1=pC+"position";
+ if(!islist(parse(tmp1)),
+ tmp=tmp1+"="+textformat(parse(pC).xy,6)+";";
+ parse(tmp);
+ ,
+ tmp=parse(pC).xy;
+ tmp2=mouse().xy;
+ if(|tmp-tmp2|>sep,
+ tmp=pC+".xy="+pC+"position";
+ parse(pC).xy=parse(pC+"position");
+ ,
+ tmp=tmp1+"="+Textformat(parse(pC).xy,6)+";";
+ parse(tmp);
+ );
+ );
+);
+////%Strictmove end////
+
////%Slider start////
Slider(ptstr,p1,p2):=Slider(ptstr,p1,p2,[]);
Slider(ptstr,p1,p2,options):=(//190120
//help:Slider("A-C-B",[-3,0],[3,0]);
//help:Slider("C",[-3,0],[3,0]);
-//help:Slider(options=["Color=0.6*[0,0,1]","Size=2"]);
- regional(pA,pB,pC,seg,sname,Alpha,color,size,tmp,tmp1);
+//help:Slider(options=["Color=[0,0,0.6]","Thick=2"]);
+//help:Slider(options2=["Sep=0.3"]); //190824
+ regional(pA,pB,pC,color,thick,sep,tmp,tmp1,tmp2);
color="Color=0.6*[0,0,1]"; //190120from
- size="size->2";
+ thick="size->2";
+ sep=0.3; //190824
forall(options,
tmp=Toupper(substring(#,0,1));
if(tmp=="C",
color=#;
);
- if(tmp=="S",
+ if(tmp=="T",
tmp=Strsplit(#,"=");
- size="size->"+tmp_2;
+ thick="size->"+tmp_2;
);
- ); //190120to
+ if(tmp=="S",//190824from
+ tmp=Strsplit(#,"=");
+ sep=parse(tmp_2);
+ ); //190824to
+ );
tmp=Indexall(ptstr,"-");
- if(length(tmp)>0, //190209from
- pA=substring(ptstr,0,tmp_1-1);
+ if(length(tmp)>0,
+ pA=substring(ptstr,0,tmp_1-1); //190824from
pC=substring(ptstr,tmp_1,tmp_2-1);
pB=substring(ptstr,tmp_2,length(ptstr));
- seg=pA+pB;
- Alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- sname="";
- forall(1..(length(seg)),
- tmp=substring(seg,#-1,#);
- tmp1=indexof(Alpha,tmp);
- if(tmp1>0,
- sname=sname+unicode(text(tmp1+96),base->10);
- ,
- sname=sname+tmp;
- );
- );
- Putpoint(pA,p1);
- Putpoint(pB,p2);
- Listplot([parse(pA),parse(pB)],["Msg=n","notex",color,size]);
- Putonseg(pC,parse("sg"+pA+pB));
+ parse(pA).xy=p1;
+ parse(pB).xy=p2; //190824to
+ tmp1=pC+"position"; //190827from
+ if(!islist(parse(tmp1)),
+ tmp2=parse(pC).xy;
+ if(|tmp2-p1|<0.1,tmp2=p1+0.1*(p2-p1)/|p2-p1|);
+ if(|tmp2-p2|<0.1,tmp2=p2+0.1*(p1-p2)/|p1-p2|);
+ tmp=tmp1+"="+textformat(tmp2,6)+";";
+ parse(tmp);
+ parse(pC).xy=tmp2;
+ ); //190827to
PTEXCEPTION=concat(TEXCEPTION,[pA,pC,pB]);
,
- pA=""; pB=""; pC=ptstr;
- tmp=pC+"l"+pC+pC+"r";
- Listplot(tmp,[p1,p2],["Msg=n","notex",color,size]);
- Putonseg(pC,parse("sg"+tmp));
- PTEXCEPTION=concat(PTEXCEPTION,[pC]); //190329
- ); //190209to
+ pC=ptstr; pA=pC+"l"; pB=pC+"r";
+ PTEXCEPTION=concat(PTEXCEPTION,[pC]);
+ );
+ Listplot(pA+pB,[p1,p2],["Msg=n","notex",color,thick]);
+ Putonseg(pC,parse("sg"+pA+pB));
);
////%Slider end////
@@ -3245,21 +3179,6 @@ Putpoint(name,Ptinit,Pt):=(
);
////%Putpoint end////
-////%Putpoint start////
-Putpoint(name,Pt):=Putpoint(name,Pt,Pt);
-Putpoint(name,Ptinit,Pt):=(
-//help:Putpoint("A",[1,2],[1,A.y]);
- regional(ptstr);
- ptstr=apply(allpoints(),#.name);//16.10.06
- if(!contains(ptstr,name),
- createpoint(name,Pcrd([Ptinit_1,Ptinit_2]));
- ,
- ptstr=name+".xy="+Textformat(Pcrd(Pt),5)+";";
- parse(ptstr);
- );
-);
-////%Putpoint end////
-
////%Bezierpt start////
Bezierpt(t,ptlist,ctrlist):=(
regional(flg3,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9);
@@ -3367,7 +3286,7 @@ Beziercurve(nm,ptlistorg,ctrlistorg,options):=(
tmp2=RSform(tmp2,3); //17.12.23
GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -4150,17 +4069,14 @@ Fourierseries(nm,coefforg,per,nterm,range,optionorg):=(
cn=coeff_2;
sn=coeff_3;
fs=c0;
+ fn="(cn)*cos(n*2*pi/per*x)+(sn)*sin(n*2*pi/per*x)";
+ fn=Assign(fn,["cn",cn,"sn",sn,"per",per]);
if(tbflg=="N", //190523
forall(1..nterm,
- tmp=parse(Assign(cn,["n",#]));
- tmp1=Assign("("+format(tmp,5)+")*cos(n*2*pi/per*x)",
- ["n",#,"per",per]);
- tmp=parse(Assign(sn,["n",#]));
- tmp2=Assign("("+format(tmp,5)+")*sin(n*2*pi/per*x)",
- ["n",#,"per",per]);
- fs=fs+"+"+tmp1+"+"+tmp2;
- );
- Plotdata("-four"+nm,fs,range,append(options,"Num="+Num));
+ fs=fs+"+"+Assign(fn,["n",#]);
+ );
+ Deffun("four(x)",[fs]);
+ Plotdata("-four"+nm,"four(x)",range,append(options,"Num="+num));
,
c0=parse(c0); //190523from
cn=apply(1..nterm,parse(Assign(cn,["n",#])));
@@ -4814,6 +4730,7 @@ Windispg(gcLorg):=( //190125
if(length(gcL)>0,
if(!islist(gcL_1),gcL=[gcL]);
); //190125to
+ gcL=select(gcL,#_2_1>=0); //190818
gsave();
layer(KETPIClayer);
forall(gcL,Nj,
@@ -4856,7 +4773,7 @@ Windispg(gcLorg):=( //190125
);
,
if(indexof(opcindy,"size")==0, //190425from
- opcindy=opciny+",size->"+text(TenSize/TenSizeInit);
+ opcindy=opcindy+",size->"+text(TenSize/TenSizeInit);
); //190425to
tmp="draw("+text(Nk_1)+opcindy+");";
parse(tmp);
@@ -4913,7 +4830,7 @@ Extractdata(number,name,options):=(
];
GLIST=concat(GLIST,tmp3); //no ketjs off
);
- if(Noflg<2,
+ if(Noflg<3, //190818
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
Texcom("{");Com2nd("Setcolor("+color+")");//180722