Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function f(x) {
- return (Math.sin(x)*Math.cos(2*x)) ;
- }
- var zoom=20
- var amp=20
- function update(){
- zoom=mouseX/10
- amp=mouseY/10
- }
- function draw() {
- for(i=-100;i<400;i=i+0.009){ //800 is the max horizontal screen size
- //point is the value of the var
- point= -(f(i))*zoom*amp;
- context.fillRect(i*zoom+400,point+300,1,1);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement