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;
}