*********** Initialization/KETlib ********** use("KetCindyPlugin"); Dircdy=loaddirectory; setdirectory(plugindirectory); import("ketcindy.ini"); Divisor(n):=( regional(out,tmp); out=[]; forall(1..(round(sqrt(n))), if(mod(n,#)==0, tmp=round(n/#); out=concat(out,[#,tmp])); ); out=sort(out); out; ); *********** Drow/figures ********** Ketinit(); Setparent(Cdyname()+"fig"); Setketcindyjs(["Nolbl=all","Loc=n"]);//no ketjs Ketcindyjsbody(["
_;対称移動"],[]);
Setwindow([-5,5],[-5,5]);
//分数表示の分母のリスト
dvtmp=pairs([1,2,3,4,5]);
dvtmp=concat(dvtmp,apply(1..5,[#,#]));
dvtmp=apply(dvtmp,#_1*#_2);
dvL=remove(Divisor(mm^2+nn^2),[1]);
forall(dvL,dv,
dvtmp=concat(dvtmp,apply(dvtmp,#*dv));
);
dvtmp=set(dvtmp);
mm=3;
nn=2;
str="fr(3,2)";
//str=Textedit(50);// only ketjs
tmp=indexof(str,"=");
if(tmp>0,
str=substring(str,tmp,length(str));
);
if(length(str)>0,
tmp=Tocindyform(str);
tmp=Strsplit(tmp,"/");
tmp=apply(tmp,parse(#));
mm=round(tmp_1); nn=1;
if(length(tmp)==2,
nn=tmp_2;
);
// texm=Totexform(str);
texm=mm/nn;
texm=Totexform(Op(1,Fracform(texm,dvtmp)));
aaa=mm/nn;
if(5/aaa<5 & -5<5/aaa,
tmp1=[5/aaa,4.8];
,
aah=min([5,aaa*5]);
tmp1=[5,aah];
);
tmp2=["Size=1.5"];
if(nn==1,
if(mm==0,
Expr([5,0.5],"ne","y=0",tmp2);
,
);
if(mm==1,
Expr(tmp1,"nw","y=x",tmp2);
,
);
if(mm==-1,
Expr(tmp1,"ne","y=-x",tmp2);
,
);
if(1