Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *Autor: Miguel Yurivilca
- */
- float g = 9.81;
- float v0 = 40;
- float x = 0;
- float y = 0;
- float angle = 70 * TWO_PI / 360.0;
- float t = 0;
- void setup()
- {
- size(1200, 800);
- background(255, 255, 255);
- }
- void draw()
- {
- x = v0 * t * cos(angle) * 10;
- y = -1 *(v0 * t * sin(angle) - ((0.5) * g * pow((t), 2))) * 5;
- background(255, 255, 255);
- translate(100, 600);
- ellipse(x, y, 50, 50);
- t = t + 0.01;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement