标签:pre int span turn div style ret blog 四点共面
1 //返回值为0的时候四点共面 2 int is_coplanar(point a,point b,point c,point d){ 3 point ab,ac,ad; 4 ab.x=a.x-b.x,ab.y=a.y-b.y,ab.z=a.z-b.z; 5 ac.x=a.x-c.x,ac.y=a.y-c.y,ac.z=a.z-c.z; 6 ad.x=a.x-d.x,ad.y=a.y-d.y,ad.z=a.z-d.z; 7 int tmp=ab.x*ac.y*ad.z+ab.y*ac.z*ad.x+ac.x*ad.y*ab.z; 8 tmp-=ab.z*ac.y*ad.x+ab.x*ac.z*ad.y+ab.y*ac.x*ad.z; 9 return tmp; 10 }
标签:pre int span turn div style ret blog 四点共面
原文地址:http://www.cnblogs.com/Leonard-/p/7667360.html