- function createCosGraphic(nPoint, space, amplitude, interval) {
- centre = new Object({x:200, y:200});
- setInterval(function () {
- with (_root) {
- j++;
- clear();
- lineStyle(-1, 0x000000, 100);
- moveTo(centre.x+0, centre.y+Math.cos(j/amplitude)*amplitude);
- for (i=0; i<=nPoint; i++) {
- lineTo(centre.x+i*space, centre.y+Math.cos(i+j/amplitude)*amplitude);
- }
- }
- }, interval);
- }
- createCosGraphic(64, 2, 10, 20);
function createCosGraphic(nPoint, space, amplitude, interval) {
centre = new Object({x:200, y:200});
setInterval(function () {
with (_root) {
j++;
clear();
lineStyle(-1, 0x000000, 100);
moveTo(centre.x+0, centre.y+Math.cos(j/amplitude)*amplitude);
for (i=0; i<=nPoint; i++) {
lineTo(centre.x+i*space, centre.y+Math.cos(i+j/amplitude)*amplitude);
}
}
}, interval);
}
createCosGraphic(64, 2, 10, 20);