Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function f(x) {
  2. return (Math.sin(x)*Math.cos(2*x)) ;
  3. }
  4. var zoom=20
  5. var amp=20
  6. function update(){
  7. zoom=mouseX/10
  8. amp=mouseY/10
  9. }
  10. function draw() {
  11. for(i=-100;i<400;i=i+0.009){ //800 is the max horizontal screen size
  12. //point is the value of the var
  13. point= -(f(i))*zoom*amp;
  14. context.fillRect(i*zoom+400,point+300,1,1);
  15. }
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement