t=0.5 theta<-seq(0,4*pi,0.001) theta<-theta[(cos(2.5*theta)+1.9)<=(cos(2.5*pi/5)+1.9)] x<-c((cos(2.5*theta)+1.9)*cos(theta),-.4,-.18) y<-c((cos(2.5*theta)+1.9)*sin(theta),.6,.87) par(mfrow=c(2,3),pty="s") plot(x=c(-3,3),y=c(-3,3),type="n",main="star",xlab=NULL,ylab=NULL) abline(h=0) abline(v=0) points(x,y,col=2) a<-x b<-0*y plot(x=c(-3,3),y=c(-3,3),type="n",main="projection") abline(h=0) abline(v=0) points(a,b,col=5) a<-1.6*x b<-1.6*y plot(x=c(-3,3),y=c(-3,3),type="n",main="scaling (dilation or contraction)") abline(h=0) abline(v=0) points(a,b,col=3) a<-x+y b<-y plot(x=c(-3,3),y=c(-3,3),type="n",main="shearing") abline(h=0) abline(v=0) points(a,b,col=6) a<-x+y b<-y plot(x=c(-3,3),y=c(-3,3),type="n",main="shearing+reflection") abline(h=0) abline(v=0) points(-a,b,col=4) a<-cos(t*pi)*x-sin(t*pi)*y b<-sin(t*pi)*x+cos(t*pi)*y plot(x=c(-3,3),y=c(-3,3),type="n",main="rotation") abline(h=0) abline(v=0) points(a,b,col="brown") #----------------------------------------------- t=0.5 theta<-seq(0,4*pi,0.001) theta<-theta[(cos(2.5*theta)+1.9)<=(cos(2.5*pi/5)+1.9)] x<-c((cos(2.5*theta)+1.9)*cos(theta),-.4,-.18) y<-c((cos(2.5*theta)+1.9)*sin(theta),.6,.87) par(mfrow=c(1,3),pty="s") plot(x=c(-3,3),y=c(-3,3),type="n",main="star",xlab=NULL,ylab=NULL) abline(h=0) abline(v=0) points(x,y,col=2) i=1/3 j=1/4 a<-cos(2*i*pi)*x+sin(2*i*pi)*y b<-sin(2*i*pi)*x-cos(2*i*pi)*y plot(x=c(-3,3),y=c(-3,3),type="n",main="reflection once") abline(h=0) abline(v=0) abline(0,tan(i*pi),col="green") points(a,b,col="brown") c<-cos(2*j*pi)*a+sin(2*j*pi)*b d<-sin(2*j*pi)*a-cos(2*j*pi)*b plot(x=c(-3,3),y=c(-3,3),type="n",main="reflection twice") abline(h=0) abline(v=0) abline(0,tan(j*pi),col="green") points(c,d,col="blue")