题解 P4710 【「物理」平抛运动】
曦行夜落
2018-06-21 12:15:57
小学蒟蒻路过
首先要明确,水平速度为$Vsinθ$,垂直速度为$gt$或$Vcosθ$
我们可以将速度V分解
接下来我们算出解题中最关键的t,也就是落地的时间
我们知道垂直速度可以表示为$gt$或$Vcosθ$
也就是说:
$gt=Vcosθ $
$t=\frac{Vcosθ}{g}$
求出t之后,我们就可以算出$x_0$与$y_0$了:
$x_0=tVsinθ$
$y_0=\frac{1}{2}tVcosθ$
然后?就没有然后了:
------------
```cpp
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
#define g 10
using namespace std;
int main()
{
double t,v,cita,vx,vy,x0,y0;
scanf("%lf%lf",&v,&cita);
vy=v*cos(cita);
t=vy/g;
vx=v*sin(cita);
x0=vx*t; y0=0.5*vy*t;
printf("%.15f %.15f",x0,y0);
return 0;
}
```