1,上面的那條邊和半徑的延長線重合,也就是上面的那個邊帶着這個塊塊漂移。
2,左下角是最容易出軌道的。
3,d如果很小,左下角沒進入彎道就直行了。
不知道爲什麼 M_PI不能用
熟悉怎麼用三角函數
double sin (double);
double cos (double);
double tan (double);
double atan (double);
double acos(double x)
double asin(double x)
這裏面只有弧度沒有度
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=100005;
int main()
{
int t; scanf("%d",&t);
while(t--)
{
double a,b,r,d;
cin>>a>>b>>r>>d;
//double k=acos(-1);
double k=3.14159265358979323846;
d= (k*d)/180.0;
double w;
if( d >= atan(b/(a+r))){
w=sqrt((b*b+(a+r)*(a+r)))-r;
}
else{
w=(a+r)/cos(d)-r+sin(d)*(b-(a+r)*tan(d));
}
printf("%.12lf\n",w);
}
return 0;
}