This is my code everything works fine but i want more circles to appear can someone tell
Question:
This is my code everything works fine but i want more circles to appear can someone tell me how i can multiply the circles thanks
function Circle() { this.name = "circle"; var x = 0; var y = 0;
var spectrumSpeed = 2;
this.draw = function(){
var spectrum = fourier.analyze(); // Increment x position of spectrum by 2 pixels every frame x += spectrumSpeed; // noise to move y position of spectrum y = noise(frameCount * 0.003) * height;
// Bounce spectrum back and forth horizontally if(x > width || x < 0){ spectrumSpeed *= -1; } noStroke(); for (var i = 0; i < spectrum.length; i++){ var c = map(spectrum[i], 0,255, 255, 0); fill(0,spectrum[i],c); var size = map(spectrum[i],0, 255, 0, random(0,width/3)); circle(x,y, size); };
} }
College Algebra With Modeling And Visualization
ISBN: 9780134418049
6th Edition
Authors: Gary Rockswold