dev.new() ###漸化式プロット**** #library(rgl) #rgl.bg(color="black") x1=0.1;y1=0.1 plot(x1, y1,xlim=c(-10,15),ylim=c(-10,10),bg="blue") n=5 for (i in 1:60000){ ######## switch(n, # switch(整数, {a=0.55;b=-1.00025;c=2.5 x2=y1+a*x1+b+c/(1+x1^2) y2=b*x1      fm<-paste("x2=y1+a*x1+b+c/(1+x1^2)","  y2=b*x1")}, # 1 のときに実行 {a=-0.99;b=1;c=4.8 x2= a*x1+b*y1+c/(1+x1^2)-4.55     y2=x1*a fm<-paste("x2=a*x1+b*y1+c/(1+x1^2)-4.55","  y2=x1*a")}, # 2 のときに実行 {a=1;b=0.87;c=1 x2=a*x1-b*y1-c/(x1+1) y2=b*x1+0.1*x2 fm<-paste("x2=a*x1-b*y1-c/(x1+1)","  y2=b*x1+0.1*x2")}, # 3 のときに実行 {a=2.5;b=-3;c=1 x2=a*sin(x1)+b*cos(y1)   y2=a*x1+c*x2 # 4 fm<-paste("x2=a*sin(x1)+b*cos(y1)"," y2=a*x1+c*x2")}, {a=-1.26;b=1.00;c=4 x2=a*x1+b*y1+c/(1+x1^2)   y2=-b*x1 # 5 fm<-paste("x2=a*x1+b*y1+c/(1+x1^2)"," y2=-b*x1")} ) ####### par(new=T) cl=1-i%%255/255 cl1=i%/%2000 par(cex=0.2) #plot(x2, y2,xlim=c(-10,15),ylim=c(-10,10),col=i,type="p",pch=20,ps=2) points(x2, y2,col =cl1,ps=1) #points(x2, y2,col = "#3A00ff50") x1=x2;y1=y2 } par(cex=1); pa<-paste("a=",a," b=",b," c=",c) mtext(pa,1,0,col=2) mtext(fm,3,0,col=4) title("漸化式表示") x2;y2