题解 P4710 【「物理」平抛运动】
物理小知识
题目已经给出了速度分解的方法
易得
同理可得
我们就可以分解出质点砸到点 (0,0) 的速度。
解法
其中水平方向上的速度
意思就是分解出的
抛出时的横坐标
那么时间
根据
求出
根据题目给的公式
code
#include<cmath>
#include<cstdio>
#include<iostream>
using namespace std;
double v,O;
int main(){
cin>>v>>O;
double vx,vy;
vx=sin(O)*v; //给的是弧度制,就直接调用
vy=cos(O)*v;
double t;
t=vy/10.0; //注意这里的10.0和下面的2.0一样,要加上一位小数,否则除完会被强制类型转换
double ansx,ansy;
ansx=t*vx;
ansy=t*vy/2.0;
printf("%.15lf %.15lf",ansx,ansy); //保留15位小数
}