<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<style>
v/:* {behavior:url(#default#VML);}
o/:* {behavior:url(#default#VML);}
x/:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<xml>
<o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml>
<xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml>
</head>
<body>
Fourier series:<button οnclick=movetox()> Click Me to Wave...</button> By Gu Laicheng, 14:17 2007-3-9
<script>
//由width:10pt;height:10pt; 控制圆的大小
var period = 5; //周期
var swing = 100; //振幅
var serials = 0; //级数
var r = 5; //点圆半径
var density = 10; //角速度
var x0 = 180; //左起
var y0 = 280; //中线
var offset = 1; //平移动量
var speed = 20; //平移动速度(s)
var pi = Math.PI; //3.1415926
var fillcolor = "#000000"; //小圆填充颜色
var strokecolor = "#000000"; //小圆边线颜色
var str = "";
var aa = 0;
var a=0;
// 以下除以3,是为了保持在屏幕上合适地显示5个周期
// 如果周期显示的多,而角速度小,可能造成点的个数太多,影响屏幕显示
lx = (360 * period)/2.5 ;
document.write("<v:line id=vml1 style='POSITION:absolute;Z-INDEX:3001;LEFT:"+x0+"px;TOP:"+(y0-swing-40)+"px' from='0,0' to='0,"+(swing*2+80)+"px' strokecolor='#0000DD' strokeweight='1px'/>");
document.write("<v:line id=vml2 style='POSITION:absolute;Z-INDEX:3003;LEFT:"+x0+"px;TOP:"+y0+"px' from='0,0' to='"+(lx+40)+",0px' strokecolor='#0000DD' strokeweight='1px'/>");
document.write("<v:line id=vml3 style='POSITION:absolute;Z-INDEX:3005;LEFT:"+x0+"px;TOP:"+(y0-swing)+"px' from='0,0' to='"+lx+",0px' strokecolor='#EEDDDD' strokeweight='1px'/>");
document.write("<v:line id=vml4 style='POSITION:absolute;Z-INDEX:3006;LEFT:"+x0+"px;TOP:"+(y0+swing)+"px' from='0,0' to='"+lx+",0px' strokecolor='#EEDDDD' strokeweight='1px'/>");
for(var a0=0;a0<=(360 * period);a0=a0+density){
aa = (a + a0) * pi/180 ;
kx=x0+a0/2.5;
ky = y0 ;
for(i0=0;i0<=serials;i0++) {
ky = ky - swing * Math.sin((2*i0+1)*aa)/(2*i0+1)
}
str = str +"<v:oval id='_glc0"+a0+"' ";
str = str +"style='position:absolute;left:"+kx+"px;top:"+ky+"px;width:"+r+"px;height:"+r+"px;z-index:4001;cursor:move' ";
str = str +"fillcolor='"+fillcolor+"' strokecolor='"+strokecolor+"' strokeweight='2px' strokecolor='windowText [64]'/>";
}
document.write(str);
function movetox() {
theTime = setTimeout("movetox()", speed);
var today = new Date();
var display= today.toLocaleString();
status=""+a+"-"+display;
for(var a0=0;a0<=(360 * period);a0=a0+density){
obj2=eval("_glc0"+a0);
aa = (a + a0) * pi /180;
yy = y0 ;
for(i0=0;i0<=serials;i0++) {
yy = yy - swing * Math.sin((2*i0+1)*aa)/(2*i0+1)
}
obj2.style.top=yy;
}
if(a>=(360 * period)) a = 0;
a=a+offset;
}
document.write("<br>");
document.write("周期:"+period+"<br>")
document.write("振幅:"+swing+"<br>")
document.write("级数:"+serials+"<br>")
document.write("点圆半径:"+r+"<br>")
document.write("角速度:"+density+"<br>")
document.write("左起:"+x0+"<br>")
document.write("中线:"+y0+"<br>")
document.write("平移动量:"+offset+"<br>")
document.write("平移动速度:"+speed+"<br>")
</script>
</body>
</html>