Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define g 9.8
- #define y0 20
- int main(void)
- {
- float t,tv;;
- float y=y0;
- tv=sqrt(2*y0/g);
- printf("t(s)\t y(m)\n");
- // int t=0;
- // float y=y0;
- // printf("t(s)\t y(m)\n");
- // while (y>=0.0)
- //{
- // y=y0-g*t*t/2;
- // printf("%d\t %f\n",t,y);
- // t++;
- //}
- // ver tempo limite pra não passar do chão!! "tempo total de vôo":
- // tv=sqrt(2*y0/g);
- for (t=0;t<=tv;t+=0.1)
- {
- y=y0-g*t*t/2.;
- printf("%.2f\t %f\n",t,y);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement