思路:高中物理小case
代码:
#include<stdio.h>
#include<math.h>
#define g 10
int main()
{
float v,o,vg,vx,t,x0,y0;
scanf("%f%f",&v,&o);
vg = cos(o)*v;
t = vg/g;
y0 = 0.5*g*t*t;
vx = v*sin(o);
x0 = vx*t;
printf("%f %f",x0,y0);
return 0;
}
思路:高中物理小case
代码:
#include<stdio.h>
#include<math.h>
#define g 10
int main()
{
float v,o,vg,vx,t,x0,y0;
scanf("%f%f",&v,&o);
vg = cos(o)*v;
t = vg/g;
y0 = 0.5*g*t*t;
vx = v*sin(o);
x0 = vx*t;
printf("%f %f",x0,y0);
return 0;
}