summaryrefslogtreecommitdiff
path: root/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs')
-rw-r--r--graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs531
1 files changed, 261 insertions, 270 deletions
diff --git a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs b/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs
index 5f65ad6c50..2b382904cb 100644
--- a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs
+++ b/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic2r.cs
@@ -14,7 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindylibbasic2[20190921] loaded");
+println("ketcindylibbasic2[20191208] loaded");
//help:start();
@@ -120,10 +120,10 @@ Setarrow(arglist):=(
if((tmp_1>0),YaSize=tmp_1);
);
if(length(tmp)>=2,
- if((tmp_2>0)&(tmp_2<90),YaAngle=tmp_2);
+ if(tmp_2<2.5,YaAngle=tmp_2*YaAngle,Yaangle=tmp_2); //191123
);
if(length(tmp)>=3,
- if((tmp_3>=0)&(tmp_3<=1),YaPosition=tmp_3);
+ YaPosition=tmp_3; //191114
);
if(length(tmp)>=4,
if((tmp_4>=0)&(tmp_4<1),YaCut=tmp_4);
@@ -137,99 +137,113 @@ Setarrow(arglist):=(
////%Setarrow end////
////%Arrowheaddata start////
-Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]);
-Arrowheaddata(point,direction,options):=(
+Arrowheaddata(point,direction):=
+ Arrowheaddata(point,direction,[YaSize,YaAngle,YaPosition,YaCut]);
+Arrowheaddata(point,direction,options):=( //191127remade
// help:Arrowheaddata(A,B);
-// help:Arrowheaddata(options=[size(1),angle(18), "Coord=phy"]);
- regional(list,ookisa,hiraki,Houkou,Str,Flg,Ev,Nv,pA,pB,
- reL,eqL,coord,pP,rF,gG,Flg,Nj,Eps,scx,scy,tmp,tmp1,tmp2);
- Eps=10^(-3);
- coord="P";
- ookisa=0.2*YaSize;
- hiraki=YaAngle;
- iti=1;
- kiri=0;
- Futosa=0;
- Str=YaStyle;
+// help:Arrowheaddata("1",A,"gr1");
+// help:Arrowheaddata("1",A,gr1);
+// help:Arrowheaddata(options=[size(1),angle(18),pos(1),cut(0)]);
+ regional(scaley,Eps,size,angle,segpos,cut, Houkou,hflg,Str,Ev,Nv,
+ reL,pP,vec,pA,pB,pC,par,out,tmp,tmp1,tmp2);
+ Eps=10^(-4);
tmp=Divoptions(options);
- eqL=tmp_5; //181018from
reL=tmp_6;
- forall(eqL,
- tmp=Strsplit(#,"=");
- tmp1=substring(tmp_1,0,1);
- tmp2=substring(tmp_2,0,1);
- if(Toupper(tmp1)=="C",
- coord=Touppera(tmp2);
- );
- ); //181018to
- forall(1..(length(reL)), //181110from
- tmp=reL_#;
- if(#==1,ookisa=ookisa*tmp);
- if(#==2,
- if(tmp<5,
- hiraki=hiraki*tmp;
- ,
- hiraki=tmp;
+ size=0.2*YaSize*1/2.54*1000/MilliIn;
+ angle=YaAngle*pi/180;
+ segpos=YaPosition;
+ cut=YaCut;
+ if(length(reL)>=1,
+ size=0.2*reL_1*1/2.54*1000/MilliIn;
+ );
+ if(length(reL)>=2,
+ if(reL_2<2.5,angle=reL_2*YaAngle,angle=reL_2);
+ angle=angle*pi/180;
+ );
+ if(length(reL)>=3,
+ segpos=reL_3;
+ );
+ if(length(reL)>=4,
+ cut=reL_4;
+ );
+ if(ispoint(point),pP=Lcrd(point),pP=point);
+ hflg=0;
+ out=[];
+ if(ispoint(direction),
+ Houkou=direction.xy;
+ hflg=2;
+ );
+ if(hflg==0, //191203from
+ if(!isstring(direction), //191207
+ if(Measuredepth(direction)==0,
+ Houkou=direction;
+ hflg=2;
);
- );
- ); //181110to
- Flg=0;
- hiraki=hiraki*pi/180;
- if(ispoint(direction),Houkou=direction.xy); //181018
- if(isstring(direction),Houkou=parse(direction),Houkou=direction);
- if(Measuredepth(Houkou)==2,Houkou=Houkou_1);
- if(coord=="P",//181018from
- if(ispoint(point),pP=point.xy,pP=point);
- ,
- pP=Pcrd(point);
- if(!islist(Houkou_1),
- Houkou=Pcrd(Houkou);
+ ); //191207to
+ ); //191203to
+ scaley=SCALEY;
+ Setscaling(1); //191203(moved)
+ if(hflg==0,
+ if(isstring(direction),Houkou=parse(direction),Houkou=direction);
+ if(!islist(pP),
+ par=1+(length(Houkou)-1)*pP; //191207
+ pP=Ptcrv(par,Houkou);
+ tmp=floor(tmp); //191203from
,
- Houkou=apply(Houkou,Pcrd(#));
- );
- );//181018to
- if(islist(Houkou_1),
- tmp=Nearestpt(pP,Houkou);
- pP=tmp_1;
- rF=floor(tmp_2);
- if(rF==1,
- if(|Ptend(Houkou)-Ptstart(Houkou)|<Eps,
- rF=Numptcrv(Houkou);
- );
- );
- gG=apply(0..10,pP+ookisa*cos(hiraki)*[cos(2*pi/10*#),sin(2*pi/10*#)]);
- Flg=0;
- forall(1..rF,Nj,
- if(Flg==0,
- pB=Ptcrv(rF+1-Nj,Houkou);
- tmp1=apply([pP,pB],LLcrd(#));
- tmp2=apply(gG,LLcrd(#));
- tmp=Intersectcrvspp([pP,pB],gG);
- if(length(tmp)>0,
- Houkou=pP-Pcrd(tmp_1_1);
- Flg=1;
- );
- );
+ tmp=Nearestpt(pP,Houkou);
+ pP=tmp_1;
+ par=tmp_2;
+ tmp=floor(par); //191203to
+ );
+ if(tmp<length(Houkou),
+ tmp1=Houkou_tmp;
+ tmp2=Houkou_(tmp+1);
+ ,
+ tmp1=Houkou_(tmp-1);
+ tmp2=Houkou_tmp;
);
- if(Flg==0,
+ vec=(tmp2-tmp1)/|tmp2-tmp1|;
+ gG=Circledata("",[pP,size*cos(angle)],["Num=10","nodata"]);
+ tmp1=Intersectcrvspp(Houkou,gG);
+ if(length(tmp1)==0,
println("Arrowhead may be too large (no intersect)");
- Flg=2;
- );
- );
- if(Flg<2,
- Ev=-1/|Houkou|*Houkou;
- Nv=[-Ev_2, Ev_1];
- if(indexof(Str,"c")>0,
- pP=pP-0.5*ookisa*cos(hiraki)*Ev;
- );
- if(indexof(Str,"b")>0,
- pP=pP-ookisa*cos(hiraki)*Ev;
- );
- pA=pP+ookisa*cos(hiraki)*Ev+ookisa*sin(hiraki)*Nv;
- pB=pP+ookisa*cos(hiraki)*Ev-ookisa*sin(hiraki)*Nv;
- list=[pA,pP,pB];
- list;
+ ,
+ tmp=select(tmp1,#_2<par); //191208from
+ if(length(tmp)>0,
+ tmp=sort(tmp,[-#_2]);
+ pC=tmp_1_1;
+ ,
+ if(Norm(Ptend(direction)-Ptstart(direction))>Eps,
+ tmp=sort(tmp1,[#_2]);
+ pC=2*pP-tmp_1_1;
+ ,
+ tmp=sort(tmp1,[-#_2]);
+ pC=tmp_1_1;
+ );
+ ); //191208to
+ Houkou=pP-pC;
+ hflg=1;
+ );
+ );
+ if(hflg>=1,
+ Ev=-Houkou/|Houkou|;
+ Nv=[-Ev_2, Ev_1];
+ pA=pP+size*cos(angle)*Ev+size*sin(angle)*Nv;
+ pB=pP+size*cos(angle)*Ev-size*sin(angle)*Nv;
+ if(hflg==2,
+ pC=(pA+pB)/2;
+ );
+ pC=pC+cut*(pP-pC);
+ tmp=(pP-(pA+pB)/2);
+ tmp=(1-segpos)*tmp;
+ pP=Translatepoint(pP,tmp);
+ pA=Translatepoint(pA,tmp);
+ pB=Translatepoint(pB,tmp);
+ pC=Translatepoint(pC,tmp);
+ Setscaling(scaley);
+ out=apply([pA,pP,pB,pC,pA],LLcrd(#));
);
+ out;
);
////%Arrowheaddata end////
@@ -242,105 +256,84 @@ Arrowhead(Arg1,Arg2,Arg3):=(
Arrowhead(text(ArrowheadNumber),Arg1,Arg2,Arg3);
);
);
-Arrowhead(nm,point,direction,optionsorg):=(//181018from
+Arrowhead(nm,point,direction,optionsorg):=(//191129remade
//help:Arrowhead("1",B,B-A);
-//help:Arrowhead(options=[size(1),angle(18),position(1),cut(0),"Coord=P(L)"]);
-//help:Arrowhead(the default is -1 for numeric option);
-//help:Arrowhead(A,"gr1");
- regional(name,Ltype,Noflg,reL,opstr,opcindy,color,eqL,coord,
- options,cut,pP,Houkou,ptstr,hostr,tmp,tmp1,tmp2,list);
+//help:Arrowhead("1",[1,2],"gr1");
+//help:Arrowhead("1",0.5,"gr1");
+//help:Arrowhead(options=[size(1),angle(18),position(1),cut(0),"Line=n(y)"]);
+ regional(Eps,name,Ltype,Noflg,opstr,opcindy,color,eqL,line,
+ options,pP,Houkou,ptstr,hostr,tmp,tmp1,tmp2,list);
+ Eps=10^(-4);
name="arh"+nm; //181018
ArrowheadNumber=ArrowheadNumber+1;
options=optionsorg;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
- reL=tmp_6;
color=tmp_(length(tmp)-2);
eqL=tmp_5;
- coord="P";
+ line="N";
forall(eqL,
tmp=Strsplit(#,"=");
tmp1=substring(tmp_1,0,1);
tmp2=substring(tmp_2,0,1);
- if(Toupper(tmp1)=="C",
- coord=Toupper(tmp2);
+ if(Toupper(tmp1)=="L",
+ line=Toupper(tmp2);
options=remove(options,[#]);
);
- ); //181018to
- tmp1=[YaSize,YaAngle,YaPosition,YaCut]; //181214from
- forall(1..(length(reL)),
- if(reL_#<0, reL_#=tmp1_#);
- );
- forall((length(reL)+1)..4,
- reL=append(reL,tmp1_#);
);
- cut=reL_4;
- tmp=reL_(1..3);
- options=select(options,!isreal(#));
- options=concat(options,tmp); //181214to
- if(ispoint(direction),Houkou=direction.xy); //181018
- if(isstring(direction),Houkou=parse(direction),Houkou=direction);
- if(Measuredepth(Houkou)==2,Houkou=Houkou_1);
- if(coord=="P",//181018from
- if(ispoint(point),pP=point.xy,pP=point);
- ,
- pP=Pcrd(point);
- if(!islist(Houkou_1),
- Houkou=Pcrd(Houkou);
- ,
- Houkou=apply(Houkou,Pcrd(#));
- );
- );//181018to
- list=Arrowheaddata(pP,Houkou,options);
- if(!Inwindow(LLcrd(pP)),Noflg=2);//181018
+ list=Arrowheaddata(point,direction,options);
+ if((ispoint(point))%(islist(point)),
+ if(!Inwindow(point),Noflg=2);
+ );
if(Noflg<3,
- tmp1=apply(list,LLcrd(#));
- tmp=name+"="+Textformat(tmp1,5)+";"; //190415
+ tmp=name+"="+Textformat(list,5)+";";
parse(tmp);
- );
- if(Noflg<3, //190818
if(isstring(Ltype),
- Listplot("-arh"+nm,apply(list,LLcrd(#)),concat(options,["notex","Msg=n"]));
- );
- );
- if(Noflg==0,
- tmp=Divoptions(options);
- opstr=tmp_(length(tmp)-1);
- opstr=opstr+","+Dqq("Cut="+format(cut,5));
- ptstr=Textformat(LLcrd(pP),5);
- if(isstring(direction), //181019
- hostr=direction;
- ,
- if(!islist(Houkou_1),
- hostr=format(LLcrd(Houkou),5);
+ if(line=="N",
+ fillpoly(apply(list,Pcrd(#)),color->color);
+ if(Noflg==0,
+ if((point==1)&(isstring(direction)), //191202from
+ if(Norm(Ptend(direction)-Ptstart(direction))>Eps, //191203from
+ tmp=select(GCLIST,#_1==direction);
+ tmp=tmp_1;
+ tmp1=Nearestpt(list_4,direction);
+ tmp1=tmp1_2;
+ Partcrv(direction,1,tmp1,direction,["Msg=n"]); //191207
+ Changestyle("part"+direction,[tmp_2,tmp_3]);
+ Changestyle(direction,["nodisp"]);
+ );
+ ); //191202to
+ Listplot("-arh"+nm,list,["dr,0.1","Color="+text(color),"Msg=n"]);//191202
+ Shade(["arh"+nm],["Color="+text(color)]);
+ );
,
- hostr=format(apply(Houkou,LLcrd(#)),5);
+ Listplot("-arh"+nm,list_(1..3),concat(options,["Msg=n"]));
);
- );
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
- Texcom("{");Com2nd("Setcolor("+color+")");//180722
- ); //no ketjs off
- Com2nd("Arrowhead("+ptstr+","+hostr+opstr+")");
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
- Texcom("}");//180722
- ); //no ketjs off
+ );
);
+ list; //191202
);
////%Arrowhead end////
-////%Arrowdata start//// 190727 (<= Lightarrowdata)
-Arrowdata(ptlist):=Lightarrowdata(ptlist,[]);
-Arrowdata(Arg1,Arg2):=Lightarrowdata(Arg1,Arg2);
-Arrowdata(nm,ptlistorg,optionsorg):=Lightarrowdata(nm,ptlistorg,optionsorg);
+////%Arrowdata start//// 191119 (Arrowdataseg,Arrowdatacrv)
+Arrowdata(ptlist):=Arrowdataseg(ptlist);
+Arrowdata(Arg1,Arg2):=Arrowdataseg(Arg1,Arg2);
+Arrowdata(nm,ptlistorg,optionsorg):=(
+//help:Arrowdata("1",[A,B]);
+//help:Arrowdata("1",[p1,p2]);
+//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]);
+//help:Arrowdata(optionsadded=["line"]);
+ Arrowdataseg(nm,ptlistorg,optionsorg);
+);
////%Arrowdata end////
-////%OldArrowdata start////
-Arrowdata(ptlist):=OldArrowdata(ptlist,[]); //181110from
-OldArrowdata(Arg1,Arg2):=(
+////%Oldarrowdata start////
+Oldrrowdata(ptlist):=Oldarrowdata(ptlist,[]); //181110from
+Oldrrowdata(Arg1,Arg2):=(
regional(name);
if(isstring(Arg1),
- OldArrowdata(Arg1,Arg2,[]);
+ Oldarrowdata(Arg1,Arg2,[]);
,
name="";
forall(Arg1,
@@ -348,14 +341,14 @@ OldArrowdata(Arg1,Arg2):=(
name=name+#.name; //190505
);
);
- OldArrowdata(name,Arg1,Arg2);
+ Oldarrowdata(name,Arg1,Arg2);
);
-); //181110from
-OldArrowdata(nm,ptlistorg,optionsorg):=(
+); //181110to
+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"]);
+// help:Arrowdatacrv(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]);
+// help:Arrowdatacrv(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;
@@ -442,7 +435,7 @@ OldArrowdata(nm,ptlistorg,optionsorg):=(
);
if(Noflg<2,
if(isstring(Ltype),
- Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],append(options,"Msg=n"));
+ Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],concat(options,["Msg=n"]));
Arrowhead(nm,pA+segpos*(pB-pA),pB-pA,options); //181110
,
if(Noflg==1,Ltype=0);
@@ -451,14 +444,14 @@ OldArrowdata(nm,ptlistorg,optionsorg):=(
Setscaling(scaley); //190412
[Lcrd(pA),Lcrd(pB)];
);
-////%OldArrowdata end////
+////%Oldarrowdata end////
-////%Lightarrowdata start////
-Lightarrowdata(ptlist):=Lightarrowdata(ptlist,[]); //181110from
-Lightarrowdata(Arg1,Arg2):=(
+////%Arrowdataseg start////
+Arrowdataseg(ptlist):=Arrowdataseg(ptlist,[]); //181110from
+Arrowdataseg(Arg1,Arg2):=(
regional(name);
if(isstring(Arg1),
- Lightarrowdata(Arg1,Arg2,[]);
+ Arrowdataseg(Arg1,Arg2,[]);
,
name="";
forall(Arg1,
@@ -466,26 +459,23 @@ Lightarrowdata(Arg1,Arg2):=(
name=name+#.name; //190505
);
);
- Lightarrowdata(name,Arg1,Arg2);
+ Arrowdataseg(name,Arg1,Arg2);
);
); //181110from
-Lightarrowdata(nm,ptlist,optionsorg):=(
-//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);
+Arrowdataseg(nm,ptlistorg,optionsorg):=(
+//help:Arrowdataseg("1",[pt1,pt2]);
+//help:Arrowdataseg(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Line=n(y)"]);
+ regional(options,Ltype,Noflg,opstr,opcindy,eqL,reL,strL,color,size,lineflg,
+ flg,cutend,tmp,tmp1,tmp2,pA,pB,pC,angle,segpos,cut,scaley,Ev,Nv,pP,ptlist);
scaley=SCALEY; //190412
Setscaling(1);
ptlist=[];
forall(ptlistorg,
- if(ispoint(#),tmp=[#.x, scaley*#.y], tmp=[#_1,scaley*#_2]);
+ if(ispoint(#),tmp=[#.x, #.y], tmp=[#_1,scaley*#_2]);
ptlist=append(ptlist,tmp);
);
+ pA=ptlist_1; pB=ptlist_2;
options=optionsorg;
- tmp=select(options,isstring(#)); //181214from
- tmp1=select(tmp,contains(["dr","da","do","id"],substring(#,0,2)));
- if(length(tmp1)==0,options=append(options,YasenStyle)); //181214to
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
@@ -495,25 +485,26 @@ Lightarrowdata(nm,ptlist,optionsorg):=(
color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
- tmp1=[YaSize,YaAngle,YaPosition,YaCut]; //181214from
- forall(1..(length(reL)),
- if(reL_#<0, reL_#=tmp1_#);
- );
- forall((length(reL)+1)..4,
- reL=append(reL,tmp1_#);
+ size=0.2*YaSize*1/2.54*1000/MilliIn;
+ angle=YaAngle*pi/180;
+ segpos=YaPosition;
+ cut=YaCut;
+ if(length(reL)>=1,
+ size=0.2*reL_1*1/2.54*1000/MilliIn;
+ );
+ if(length(reL)>=2,
+ if(reL_2<2.5,angle=reL_2*YaAngle,angle=reL_2);
+ angle=angle*pi/180;
);
- size=reL_1;
- angle=reL_2;
- segpos=reL_3;
- cut=reL_4;
- lineflg=0;
- if(contains(strL,"l")%contains(strL,"L"),
- lineflg=1;
- );//181018from
- options=remove(options,strL);
+ if(length(reL)>=3,
+ segpos=reL_3;
+ );
+ if(length(reL)>=4,
+ cut=reL_4;
+ );
+ options=remove(options,reL); //191202
cutend=[0,0];//180719
- coord="P";//181018
- lineflg=1; //190504
+ lineflg=0;
forall(eqL,
tmp=Strsplit(#,"=");
tmp1=Toupper(substring(tmp_1,0,2));
@@ -523,60 +514,39 @@ Lightarrowdata(nm,ptlist,optionsorg):=(
tmp2=replace(tmp2,"]","");
cutend=tokenize(tmp2,",");
if(length(cutend)==1,cutend=[cutend_1,cutend_1]);
- options=remove(options,[#]);
);
if(tmp1=="LI",//190504from
tmp2=Toupper(substring(tmp2,0,1));
- if(tmp2=="N",lineflg=0);
- options=remove(options,[#]);
+ if(tmp2=="Y",lineflg=1);
);//190504to
);
- if(Noflg<3,
- tmp="ar"+nm+"="+Textformat([pA,pB],5)+";";
- parse(tmp);
- );
- if(Noflg<3, //190818
- if(isstring(Ltype),
- if(lineflg==1, //190504from
- Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],append(options,"Msg=n"));
- ,
- tmp=pB;
- pB=pA;
- pA=pB-tmp;
- ); //190504to
- size=0.2*size;
- angle=angle*pi/180;
- pP=pA+segpos*(pB-pA);
- Ev=-1/|pB-pA|*(pB-pA);
- Nv=[-Ev_2, Ev_1];
- tmp1=pP+size*cos(angle)*Ev+size*sin(angle)*Nv;
- tmp2=pP+size*cos(angle)*Ev-size*sin(angle)*Nv;
- ArrowheadNumber=ArrowheadNumber+1;
- Listplot("-arh"+nm,[tmp1,pP,tmp2],append(options,"Msg=n"));
- if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on
- Texcom("{");Com2nd("Setcolor("+color+")");//180722
- ); //no ketjs off
- Setscaling(scaley);
- 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
- Texcom("}");//180722
- ); //no ketjs off
+ tmp=pB-pA;
+ tmp=tmp/|tmp|;
+ pA=ptlist_1+tmp*cutend_1;
+ pB=ptlist_2-tmp*cutend_2;
+ pP=pA+segpos*(pB-pA);
+ Ev=-1/|pB-pA|*(pB-pA);
+ Nv=[-Ev_2, Ev_1];
+ tmp1=pP+size*cos(angle)*Ev+size*sin(angle)*Nv;
+ tmp2=pP+size*cos(angle)*Ev-size*sin(angle)*Nv;
+ pC=pP+(1-cut)*((tmp1+tmp2)/2-pP);
+ ArrowheadNumber=ArrowheadNumber+1;
+ if(Noflg<2,
+ if(lineflg==1,
+ Listplot("-arh"+nm,[tmp1,pP,tmp2],append(options,"Msg=n")); //191106
,
- if(Noflg==1,Ltype=0);
+ Listplot("-arh"+nm,[tmp1,pP,tmp2,pC,tmp1],["dr,0.1","Color="+color,"Msg=n"]); //191106
+ Shade(["arh"+nm],[Ltype,"Color="+color]);
+ );
+ if(lineflg==0,
+ if(segpos==1,pB=pC); //191202
);
+ Listplot("-ar"+nm,[pA,pB],[Ltype,"Color="+color,"Msg=n"]);
);
Setscaling(scaley); //190412
- [Lcrd(pA),Lcrd(pB)];
+ [LLcrd(pA),LLcrd(pB)];
);
-////%Lightarrowdata end////
+////%Arrowdataseg end////
////%Anglemark start////
Anglemark(plist):=Anglemark(plist,[]);
@@ -1944,20 +1914,17 @@ Shade(Arg1,Arg2):=(
);
);
Shade(nm,plistorg,options):=(
-//help:Shade(["gr1"],[0.5]);
-//help:Shade(["gr1"],["Color=red"]);
-//help:Shade(["gr1"],["Trim=y(n)"]); //190224
-// help:Shade(["gr1","sg1"],["Color=[1,0,0]"]);
-// help:Shade([[A,B,C,A]]);
+//help:Shade(["gr1"]);
+// help:Shade(options=["Trim=(n)","Enc=(n)",Rirst=(n)","Color=",Startpoint]);
//help:Shade(["gr2","Invert(sg1)"],["Enc=y",(Startpoint)]);
- regional(name,plist,jj,nn,trim,tmp,tmp1,tmp2,
+ regional(name,plist,jj,nn,trim,first,tmp,tmp1,tmp2,
opstr,opcindy,eqL,reL,Str,G2,flg,encflg,startpt,color,ctr);
name="shade"+nm;
plist=plistorg;
if(isstring(plist_1), // 16.01.24
- println("output Shade of "+plist);
+// println("output Shade of "+plist);
,
- println("output Shade of lists");
+// println("output Shade of lists");
);
tmp=Divoptions(options);
eqL=tmp_5;
@@ -1968,6 +1935,7 @@ Shade(nm,plistorg,options):=(
tmp=select(plist,indexof(#,"Invert")>0); //180929from
if(length(tmp)>0,encflg=1,encflg=0);
trim="N";
+ first="N"; //191007
forall(eqL,
tmp=Strsplit(#,"=");
tmp1=Toupper(tmp_1);
@@ -1983,6 +1951,9 @@ Shade(nm,plistorg,options):=(
if(substring(tmp1,0,1)=="T",
trim=substring(tmp2,0,1);
);
+ if(substring(tmp1,0,1)=="F",
+ first=substring(tmp2,0,1);
+ );
);
startpt=[];
forall(reL,
@@ -2050,11 +2021,16 @@ Shade(nm,plistorg,options):=(
);
Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+")"; //180929
nn=length(COM2ndlist); //190311from
- jj=nn;
- forall(plist,tmp1,
- tmp=select(1..nn,indexof(COM2ndlist_#,tmp1)>0);
- jj=min(append(tmp,jj));
- );
+ if(first=="Y", //191007from
+ jj=1;
+ ,
+ jj=nn;
+ forall(plist,tmp1,
+ tmp=select(1..nn,indexof(COM2ndlist_#,tmp1)>0);
+ jj=min(append(tmp,jj));
+ );
+ if(jj==0, jj=1); //191008
+ ); //191007to
tmp1=["Texcom("+Dqq("{")+")","Setcolor("+color+")",Str,"Texcom("+Dqq("}")+")"];
tmp2=COM2ndlist_(1..(jj-1));
tmp=COM2ndlist_(jj..(length(COM2ndlist)));
@@ -2066,8 +2042,6 @@ Shade(nm,plistorg,options):=(
);
////%Shade end////
-/////////// end of new Hatchdata(cindy) ///////////
-
////%Rotatepoint start////
Rotatepoint(point,Theta,ctr):=(
//help:Rotatepoint(A,2*pi/3,B);
@@ -2586,7 +2560,7 @@ Htickmark(arglist,options):=( //190203
tmp1=select(1..(length(arglist)),!isstring(arglist_#)); //180710from
forall(tmp1,nn,
Listplot("ht"+text(nn),
- [[arglist_nn,mark],[arglist_nn,-mark]],["Msg=n"]);//181017
+ [[arglist_nn,mark],[arglist_nn,-mark]],append(options,"Msg=n"));//191101
if(nn+2<=length(arglist),
tmp=arglist_(nn+2);
if(!isstring(tmp),
@@ -2613,7 +2587,7 @@ Vtickmark(arglist,options):=( //190203
tmp1=select(1..(length(arglist)),!isstring(arglist_#)); //180710from
forall(tmp1,nn,
Listplot("vt"+text(nn),
- [[mark,arglist_nn],[-mark,arglist_nn]],["Msg=n"]); //181021
+ [[mark,arglist_nn],[-mark,arglist_nn]],append(options,"Msg=n")); //191101
if(nn+2<=length(arglist),
tmp=arglist_(nn+2);
if(!isstring(tmp),
@@ -2776,9 +2750,9 @@ Drwxy(add,optionsorg):=(
if(length(tmp)>0,size=parse(tmp),size=YaSize);
tmp1=concat(options,[size,YaAngle,YaPosition,YaCut,colorax]);//181216
tmp=[[xrng_1,org_2],[xrng_2,org_2]];
- Lightarrowdata("axx"+text(AXCOUNT),tmp,tmp1);
+ Arrowdataseg("axx"+text(AXCOUNT),tmp,tmp1);
tmp=[[org_1,yrng_1],[org_1,yrng_2]];
- Lightarrowdata("axy"+text(AXCOUNT),tmp,tmp1); //190419
+ Arrowdataseg("axy"+text(AXCOUNT),tmp,tmp1); //190419
,
tmp=[[xrng_1,org_2],[xrng_2,org_2]];
tmp1=concat(options,[colorax,"Msg=n"]);//181216,190325
@@ -3168,14 +3142,15 @@ Slider(ptstr,p1,p2,options):=(//190120
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); //no ketjs on
+ regional(ptstr);
+ ptstr=apply(allpoints(),#.name); //no ketjs on //191030
if(!contains(ptstr,name),
createpoint(name,Pcrd([Ptinit_1,Ptinit_2]));
- , //no ketjs off
+ Ptpos(name,Pcrd([Ptinit_1,Ptinit_2])); //191005
+ , //no ketjs off //191030
ptstr=name+".xy="+Textformat(Pcrd(Pt),5)+";";
parse(ptstr);
- ); //no ketjs
+ ); //no ketjs //191030
);
////%Putpoint end////
@@ -4105,15 +4080,22 @@ Tabledata(Arg1,Arg2,Arg3,Arg4):=(
);
); //190428to
Tabledata(nm,xL,yL,rmvL,optionorg):=(
-//help:Tabledata(xL,yL,rmvL,["Geo=n"]);
+//help:Tabledata(xL,yL,rmvL,["Geo=y(n)"]);
//help:Tabledata(options=[2(tick,0 for no tick),"Setwin=y","Move=[0,0]"]); //190428
regional(options,geo,tmp,tmp1,tmp2);
options=optionorg;
tmp=Divoptions(options);
eqL=tmp_5;
- tmp=select(tmp_5,indexof(Toupper(#),"GEO")>0);
- if(length(tmp)>0,
- options=remove(options,tmp);
+ geo="N"; //191008from
+ forall(eqL,
+ tmp=Strsplit(#,"="); //191023
+ tmp1=Toupper(substring(tmp_1,0,1));
+ if(tmp1=="G",
+ geo=Toupper(substring(tmp_2,0,1));
+ options=remove(options,#);
+ );
+ );
+ if(geo=="Y", //191008to
Tabledatageo(nm,xL,yL,rmvL,options);
,
Tabledatalight(nm,xL,yL,rmvL,options);
@@ -4134,7 +4116,7 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=(
//help:Tabledatalight(xLst,yLst,rmvL,[0(notick)]);
//help:Tabledatalight(xLst,yLst,rmvL,[2,"Setwindow=y","Move=[0,0]"]); //190428
regional(options,rng,name,upleft,ul,flg,tick,eqL,reL,n,m,xsize,ysize,
- rlist,clist,Tb,jj,kk,tmp,tmp1,tmp2,tmp3,Eps);
+ rlist,clist,Tb,jj,kk,tmp,tmp1,tmp2,tmp3,Eps,tbstr);
// TableMove is global for Table
TABLECOUNT=TABLECOUNT+1; //190428from
TableMove=GENTEN; //190428to
@@ -4193,17 +4175,20 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=(
Tb=[clist,rlist]; //190427
tmp=name+"="+Tb+";"; //190415
parse(tmp);
+ tbstr="["; //191008
forall(0..m,jj, //190507from
tmp3="c"+text(jj);
if(length(rmvL)>=0,
tmp1="r"+text(0);
tmp2="r"+text(n);
- Tlistplot("-"+name+tmp3+tmp1+tmp2,[tmp3+tmp1,tmp3+tmp2],options);
+ Tlistplot("-"+name+tmp3+tmp1+tmp2,[tmp3+tmp1,tmp3+tmp2],options);
+ tbstr=tbstr+Dqq(name+tmp3+tmp1+tmp2)+"," //191008
,
forall(0..(n-1),
tmp1="r"+text(#);
tmp2="r"+text(#+1);
Tlistplot("-"+name+tmp3+tmp1+tmp2,[tmp3+tmp1,tmp3+tmp2],options);
+ tbstr=tbstr+Dqq(name+tmp3+tmp1+tmp2)+"," //191008
);
); //190507to
if(tick!=0, //190421
@@ -4218,11 +4203,13 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=(
tmp1="c"+text(0);
tmp2="c"+text(m);
Tlistplot("-"+name+tmp3+tmp1+tmp2,[tmp1+tmp3,tmp2+tmp3],options);
+ tbstr=tbstr+Dqq(name+tmp3+tmp1+tmp2)+"," //191008
,
forall(0..(m-1),
tmp1="c"+text(#);
tmp2="c"+text(#+1);
Tlistplot("-"+name+tmp3+tmp1+tmp2,[tmp1+tmp3,tmp2+tmp3],options);
+ tbstr=tbstr+Dqq(name+tmp3+tmp1+tmp2)+"," //191008
);
);
if(tick!=0, //190421
@@ -4231,6 +4218,10 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=(
);
);
);
+ tbstr=substring(tbstr,0,length(tbstr)-1)+"]"; //101008from
+ tmp1=parse(tbstr);
+ tmp=name+"str="+tbstr+";";
+ parse(tmp); //101008to
Changetablestyle(rmvL,["nodisp"]); //190428
Addax(0);
Eps=10^(-3);