Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. /*
  2. *Autor: Miguel Yurivilca
  3. */
  4.  
  5. float g = 9.81;
  6.  
  7. float v0 = 40;
  8.  
  9. float x = 0;
  10.  
  11. float y = 0;
  12.  
  13. float angle = 70 * TWO_PI / 360.0;
  14.  
  15. float t = 0;
  16.  
  17. void setup()
  18. {
  19. size(1200, 800);
  20. background(255, 255, 255);
  21. }
  22.  
  23. void draw()
  24. {
  25. x = v0 * t * cos(angle) * 10;
  26. y = -1 *(v0 * t * sin(angle) - ((0.5) * g * pow((t), 2))) * 5;
  27. background(255, 255, 255);
  28. translate(100, 600);
  29. ellipse(x, y, 50, 50);
  30. t = t + 0.01;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement