hdu3662 三維凸包的面的個數

2021-06-10 00:02:52 字數 1219 閱讀 5166

#include#include#include#includeusing namespace std;

#define n 600

#define eps 1e-8

struct tpoint

tpoint(double _x,double _y,double _z):x(_x),y(_y),z(_z){}

tpoint operator-(const tpoint p)

tpoint operator *(const tpoint p)

double operator ^(const tpoint p) };

struct fac

;struct t3dhull

//三角形面積 *2

double area(tpoint a,tpoint b,tpoint c)

//四面體有向體積*6

double volume(tpoint a,tpoint b,tpoint c,tpoint d)

//正:點在面的銅像

double ptoplane(tpoint &p,fac &f)

void deal(int p,int a,int b)

}} void dfs(int p,int cnt)

void construct()

}if(tmp)return;

tmp=true;

for(i=2;ieps)

}if(tmp)return;

tmp=true;

for(i=3;ieps)

}if(tmp)return;

fac add;

for(i=0;i<4;i++)

for(i=4;ieps)

}} int cnt=********cnt;

********cnt=0;

for(i=0;i}

double area()

//判斷s與t是否是同乙個面

/*因為凸包是由n個三角形組成的,所以要判斷有多少個面就要重複的三角形,用面積判斷*/

bool same(int s, int t)

//統計面的個數

int coun()

}couns+=nb;

} return couns;

}}hull;

int main()

return 0;

}

三維凸包板子 hdu 4273

hdu 4273 rescue 給乙個三維凸包,求重心到表面的最短距離 模板題 三維凸包 多邊形重心 點麵距離 include include include include includeusing namespace std const int maxn 550 const double eps...

hdu 4273 Rescue(三維凸包重心)

裸的三維凸包重心到表面的最近距離。include include include include include include include include include include include include include include define ff i,a,b for i...

uvalive5090 三維凸包

題意 給出一些三維的點,求出乙個凸包,輸出凸包有多少個表面。思路 模板。隊友找了乙個巨全面的模板,貼過來。include include include include includeusing namespace std const int maxn 550 const double eps 1e...