作者:wepiehr | 来源:互联网 | 2023-05-17 10:25
题意:给出每个圆柱的截面,求出这些圆柱的最短距离 套一下模版就可以了
#include
#include
#include
using namespace std;
const double EPS = 1e-9;
const int MAXN = 40;
struct Point3 //空间点
{
double x, y, z;
Point3( double x=0, double y=0, double z=0 ): x(x), y(y), z(z) { }
Point3( const Point3& a )
{
x = a.x;
y = a.y;
z = a.z;
return;
}
void showP()
{
printf("%f %f %f \n", x, y, z);
}
Point3 operator+( Point3& rhs )
{
return Point3( x+rhs.x, y+rhs.y, z+rhs.z );
}
};
struct Line3 //空间直线
{
Point3 a,b,c,d;
double r;
};
struct plane3 //空间平面
{
Point3 a, b, c;
plane3() {}
plane3( Point3 a, Point3 b, Point3 c ):
a(a), b(b), c(c) { }
void showPlane()
{
a.showP();
b.showP();
c.showP();
return;
}
};
double dcmp( double a )
{
if ( fabs( a ) >t;
while (t--) {
scanf("%d",&n);
for (int i=0;i