标签:直线 info void mamicode hdu code ble scanf 积分
//将圆弧看成一段段的直线段,每个单元时间为dt
//每一段路径长为 v1dt 和 v2dt
//对于v2来说,存在径向速度vx(向外) 和 切向速度vy(绕圆) (vx^2 + vy^2 = v2^2)
//又v1/R = w(角速度)= vy/r (r是运动过程中离圆心的距离)r属于[0, R]
//又因为dr = vx * dt, 所以vx = dr/dt
//所以 v2^2 = (r*v1/R)^2 + (dr/dt)^2
//所以 dr/sqrt(v2^2 - (rw)^2) = dt
//求两边积分
//得T = R/v1 * acos(v1/v2)
//或者解微分方程
//最终可以得到 r = v2/w * sin(wt), 带入r = R, w = v1/R, t = T
//得到v1/v2 = sin(v1/R * T)
//得T = R/v1 * acos(v1/v2)
void solve() {
double v1, v2, r, d;
scanf("%lf%lf%lf%lf", &v1, &v2, &r, &d);
double l = v2 / v1 * r * asin(v1 / v2);
puts(l > d ? "Why give up treatment" : "Wake up to code");
}
int main() {
int t = 1;
t = rd();
//solves();
while (t--) solve();
return 0;
}
标签:直线 info void mamicode hdu code ble scanf 积分
原文地址:https://www.cnblogs.com/wanshe-li/p/13977794.html