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 30
- #define x0 0
- #define v0y 0
- int main(void)
- {
- double t,tv,y=y0,x=x0,vy;
- tv=sqrt(2*y0/g);
- for (t=0;t<=tv;t+=0.001)
- {
- y=y0-g*t*t/2.;
- vy=v0y-g*t;
- printf("%lf\t %lf\t %lf\n",t,y,vy);
- }
- return 0;
- }
- // plotando no gnuplot:
- // plot "t2q1ia.dat" using 1:2 -> plot grafico yxt
- // plot "t2q1ia.dat" using 1:3 -> plot grafico vyxt
- // plot "t2q1ia.dat" using 2:3 -> plot grafico vyxy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement