Image:Animated.gif

From Wikipedia, the free encyclopedia

[edit] Summary

This file was created by me using the following R source code:

f=function(x) {return((x+pi)%%(2*pi)-pi)}
x=c(-3000:3000)*pi/1000
y=f(x)
b=function(n){return((-1)**(n+1)*2/n)}
y_fourier=function(n) {return(sin(x%*%t((1:n)))%*%b(1:n))}

for(i in 1:5) {
jpeg(paste("animated_",i,".jpg",sep=""))
plot(x,y,type="p",col="green", pch=".",main="Periodic version of the identity function", axes=FALSE,xlab="",ylab="")
lines(rep(pi,201),(-100:100)*pi/100,lty="dotted")
lines(rep(-pi,201),(-100:100)*pi/100,lty="dotted")
axis(side=2, pos=0,at=c(-1,1)*pi,font.axis=5,labels=c("-p","p"))
axis(side=1, pos=0,at=c(-3:3)*pi,font.axis=5,labels=c("-3p","-2p","-p","0","p","2p","3p"))
lines(x,y_fourier(i))
dev.off()
}

Then using the following shell command:

convert -delay 50 -loop 50 ani*.jpg animated.gif

-- Deimos 28 18:39, 12 March 2006 (UTC)

[edit] Licensing

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current14:29, 12 March 2006480×480 (72 KB)Deimos 28 (Talk | contribs) (Created by me using R with the following source code: {| |- f=function(x) {return((x+pi)%%(2*pi)-pi)} |- |x=c(-3000:3000)*pi/1000 |- |y=f(x) |- |b=function(n){return((-1)**(n+1)*2/n)} y_fourier=function(n) {return(sin(x%*%t((1:n)))%*%b(1:n))} |for(i in 1)
13:45, 12 March 2006480×480 (120 KB)Deimos 28 (Talk | contribs) (This file was created by me using the following [http://wwwr-project.org R] source code: f=function(x) {return((x+pi)%%(2*pi)-pi)} x=c(-3000:3000)*pi/1000 y=f(x) b=function(n){return((-1)**(n+1)*2/n)} y_fourier=function(n) {return(sin(x%*%t((1:n)))%*%b(1)

The following pages on the English Wikipedia link to this file (pages on other projects are not listed):