大白模板题,但是大白模板放这题会有精度误差,死Wa,看了个题解,也是从大白模板改的,全部都用了浮点误差,偷偷敲走。
两圆的共切线,根据两圆的圆心距从小到大排列,一共有六种情况。
1)两圆完全重合,有无数条公切线,返回-1;
2)两圆内含,没有公共点,无公切线,返回0;
3)两圆内切,有一条外公切线;
4)两圆相交,有两条外公切线;
5)两圆外切,有两条外公切线,一条内公切线;
6)两圆相离,有两条外公切线,两条内公切线;
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#define FIR first
#define SEC second
using namespace std;
const double eps = 1e-8;
const double PI = acos(-1.0);
int dcmp(double x)
{
if(fabs(x)<eps)
return 0;
return x < 0? -1: 1;
}
struct pnode
{
double x,y;
pnode(double x=0.0,double y