Advertisement
luizaspan

Corpos em queda livre a partir do repouso

Apr 30th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define g 9.8
  5. #define y0 20
  6.  
  7. int main(void)
  8. {
  9.  
  10.   float t,tv;;
  11.   float y=y0;
  12.  
  13.   tv=sqrt(2*y0/g);
  14.   printf("t(s)\t y(m)\n");
  15.  
  16.   // int t=0;
  17.   // float y=y0;
  18.  
  19.   // printf("t(s)\t y(m)\n");
  20.  
  21.   // while (y>=0.0)
  22.   //{
  23.   //  y=y0-g*t*t/2;
  24.   //  printf("%d\t %f\n",t,y);
  25.   //  t++;
  26.   //}
  27.  
  28.   // ver tempo limite pra não passar do chão!! "tempo total de vôo":
  29.   // tv=sqrt(2*y0/g);
  30.  
  31.   for (t=0;t<=tv;t+=0.1)
  32.     {
  33.       y=y0-g*t*t/2.;
  34.       printf("%.2f\t %f\n",t,y);
  35.     }
  36.  
  37.  
  38.   return 0;
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement