亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? inhedron.c

?? 是Computational Geometry in C中的原程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
   putchar('\n');   return n;}/*---------------------------------------------------------------------a - b ==> c.---------------------------------------------------------------------*/void    SubVec( tPointi a, tPointi b, tPointi c ){   int i;   for( i = 0; i < DIM; i++ )      c[i] = a[i] - b[i];}/*---------------------------------------------------------------------Returns the dot product of the two input vectors.---------------------------------------------------------------------*/double	Dot( tPointi a, tPointd b ){    int i;    double sum = 0.0;    for( i = 0; i < DIM; i++ )       sum += a[i] * b[i];    return  sum;}/*---------------------------------------------------------------------Compute the cross product of (b-a)x(c-a) and place into N.---------------------------------------------------------------------*/void	NormalVec( tPointi a, tPointi b, tPointi c, tPointd N ){    N[X] = ( c[Z] - a[Z] ) * ( b[Y] - a[Y] ) -           ( b[Z] - a[Z] ) * ( c[Y] - a[Y] );    N[Y] = ( b[Z] - a[Z] ) * ( c[X] - a[X] ) -           ( b[X] - a[X] ) * ( c[Z] - a[Z] );    N[Z] = ( b[X] - a[X] ) * ( c[Y] - a[Y] ) -           ( b[Y] - a[Y] ) * ( c[X] - a[X] );}/* Reads in the number of faces of the polyhedron and their indices from stdin,    and returns the number n. */int ReadFaces( void ){  int	i,j,k, n;  int   w; /* temp storage for coordinate. */    do {    scanf( "%d", &n );    if ( n <= PMAX )      break;    printf("Error in read_vertex:  too many points; max is %d\n", PMAX);  }  while ( 1 );  printf( "Faces:\n" );  printf( "  i   i0  i1  i2\n");  for ( i = 0; i < n; i++ ) {    scanf( "%d %d %d", &Faces[i][0], &Faces[i][1], &Faces[i][2] );    printf( "%3d:%3d%4d%4d\n", i, Faces[i][0], Faces[i][1], Faces[i][2] );    /* Compute bounding box. */    /* Initialize to first vertex. */    for ( j=0; j < 3; j++ ) {       Box[i][0][j] = Vertices[ Faces[i][0] ][j];       Box[i][1][j] = Vertices[ Faces[i][0] ][j];    }    /* Check k=1,2 vertices of face. */    for ( k=1; k < 3; k++ )    for ( j=0; j < 3; j++ ) {       w = Vertices[ Faces[i][k] ][j];       if ( w < Box[i][0][j] ) Box[i][0][j] = w;       if ( w > Box[i][1][j] ) Box[i][1][j] = w;    }    /* printf("Bounding box: (%d,%d,%d);(%d,%d,%d)\n",       Box[i][0][0],       Box[i][0][1],       Box[i][0][2],       Box[i][1][0],       Box[i][1][1],       Box[i][1][2] );    */  }  printf("n = %3d faces read\n",n);  putchar('\n');  return n;}/* Assumption: p lies in the plane containing T.    Returns a char:     'V': the query point p coincides with a Vertex of triangle T.     'E': the query point p is in the relative interior of an Edge of triangle T.     'F': the query point p is in the relative interior of a Face of triangle T.     '0': the query point p does not intersect (misses) triangle T.*/char 	InTri3D( tPointi T, int m, tPointi p ){   int i;           /* Index for X,Y,Z           */   int j;           /* Index for X,Y             */   int k;           /* Index for triangle vertex */   tPointi pp;      /* projected p */   tPointi Tp[3];   /* projected T: three new vertices */   /* Project out coordinate m in both p and the triangular face */   j = 0;   for ( i = 0; i < DIM; i++ ) {     if ( i != m ) {    /* skip largest coordinate */       pp[j] = p[i];       for ( k = 0; k < 3; k++ )	Tp[k][j] = Vertices[T[k]][i];       j++;     }   }   return( InTri2D( Tp, pp ) );}char 	InTri2D( tPointi Tp[3], tPointi pp ){   int area0, area1, area2;   /* compute three AreaSign() values for pp w.r.t. each edge of the face in 2D */   area0 = AreaSign( pp, Tp[0], Tp[1] );   area1 = AreaSign( pp, Tp[1], Tp[2] );   area2 = AreaSign( pp, Tp[2], Tp[0] );   printf("area0=%d  area1=%d  area2=%d\n",area0,area1,area2);   if ( ( area0 == 0 ) && ( area1 > 0 ) && ( area2 > 0 ) ||        ( area1 == 0 ) && ( area0 > 0 ) && ( area2 > 0 ) ||        ( area2 == 0 ) && ( area0 > 0 ) && ( area1 > 0 ) )      return 'E';   if ( ( area0 == 0 ) && ( area1 < 0 ) && ( area2 < 0 ) ||        ( area1 == 0 ) && ( area0 < 0 ) && ( area2 < 0 ) ||        ( area2 == 0 ) && ( area0 < 0 ) && ( area1 < 0 ) )     return 'E';                       if ( ( area0 >  0 ) && ( area1 > 0 ) && ( area2 > 0 ) ||        ( area0 <  0 ) && ( area1 < 0 ) && ( area2 < 0 ) )     return 'F';   if ( ( area0 == 0 ) && ( area1 == 0 ) && ( area2 == 0 ) )     fprintf( stderr, "Error in InTriD\n" ), exit(EXIT_FAILURE);   if ( ( area0 == 0 ) && ( area1 == 0 ) ||        ( area0 == 0 ) && ( area2 == 0 ) ||        ( area1 == 0 ) && ( area2 == 0 ) )     return 'V';   else       return '0';  }int     AreaSign( tPointi a, tPointi b, tPointi c )  {    double area2;    area2 = ( b[0] - a[0] ) * (double)( c[1] - a[1] ) -            ( c[0] - a[0] ) * (double)( b[1] - a[1] );    /* The area should be an integer. */    if      ( area2 >  0.5 ) return  1;    else if ( area2 < -0.5 ) return -1;    else                     return  0;}                            char    SegTriInt( tPointi T, tPointi q, tPointi r, tPointd p ){    int code = '?';    int m = -1;    code = SegPlaneInt( T, q, r, p, &m );    printf("SegPlaneInt code=%c, m=%d; p=(%lf,%lf,%lf)\n", code,m,p[X],p[Y],p[Z]);    if      ( code == '0')       return '0';    else if ( code == 'q')       return InTri3D( T, m, q );    else if ( code == 'r')       return InTri3D( T, m, r );    else if ( code == 'p' )       return InPlane( T, m, q, r, p );    else if ( code == '1' )       return SegTriCross( T, q, r );    else /* Error */       return code;}char	InPlane( tPointi T, int m, tPointi q, tPointi r, tPointd p){    /* NOT IMPLEMENTED */    return 'p';}/*---------------------------------------------------------------------The signed volumes of three tetrahedra are computed, determinedby the segment qr, and each edge of the triangle.  Returns a char:   'v': the open segment includes a vertex of T.   'e': the open segment includes a point in the relative interior of an edge   of T.   'f': the open segment includes a point in the relative interior of a face   of T.   '0': the open segment does not intersect triangle T.---------------------------------------------------------------------*/char SegTriCross( tPointi T, tPointi q, tPointi r ){   int vol0, vol1, vol2;      vol0 = VolumeSign( q, Vertices[ T[0] ], Vertices[ T[1] ], r );    vol1 = VolumeSign( q, Vertices[ T[1] ], Vertices[ T[2] ], r );    vol2 = VolumeSign( q, Vertices[ T[2] ], Vertices[ T[0] ], r );    printf( "SegTriCross:  vol0 = %d; vol1 = %d; vol2 = %d\n",       vol0, vol1, vol2 );         /* Same sign: segment intersects interior of triangle. */   if ( ( ( vol0 > 0 ) && ( vol1 > 0 ) && ( vol2 > 0 ) ) ||         ( ( vol0 < 0 ) && ( vol1 < 0 ) && ( vol2 < 0 ) ) )      return 'f';      /* Opposite sign: no intersection between segment and triangle */   if ( ( ( vol0 > 0 ) || ( vol1 > 0 ) || ( vol2 > 0 ) ) &&        ( ( vol0 < 0 ) || ( vol1 < 0 ) || ( vol2 < 0 ) ) )      return '0';   else if ( ( vol0 == 0 ) && ( vol1 == 0 ) && ( vol2 == 0 ) )     fprintf( stderr, "Error 1 in SegTriCross\n" ), exit(EXIT_FAILURE);      /* Two zeros: segment intersects vertex. */   else if ( ( ( vol0 == 0 ) && ( vol1 == 0 ) ) ||              ( ( vol0 == 0 ) && ( vol2 == 0 ) ) ||              ( ( vol1 == 0 ) && ( vol2 == 0 ) ) )      return 'v';   /* One zero: segment intersects edge. */   else if ( ( vol0 == 0 ) || ( vol1 == 0 ) || ( vol2 == 0 ) )      return 'e';      else     fprintf( stderr, "Error 2 in SegTriCross\n" ), exit(EXIT_FAILURE);}int 	VolumeSign( tPointi a, tPointi b, tPointi c, tPointi d ){    double vol;   double ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz;   double bxdx, bydy, bzdz, cxdx, cydy, czdz;   ax = a[X];   ay = a[Y];   az = a[Z];   bx = b[X];   by = b[Y];   bz = b[Z];   cx = c[X];    cy = c[Y];   cz = c[Z];   dx = d[X];   dy = d[Y];   dz = d[Z];   bxdx=bx-dx;   bydy=by-dy;   bzdz=bz-dz;   cxdx=cx-dx;   cydy=cy-dy;   czdz=cz-dz;   vol =   (az-dz) * (bxdx*cydy - bydy*cxdx)         + (ay-dy) * (bzdz*cxdx - bxdx*czdz)         + (ax-dx) * (bydy*czdz - bzdz*cydy);   /* The volume should be an integer. */   if      ( vol > 0.5 )   return  1;   else if ( vol < -0.5 )  return -1;   else                    return  0;}/*  This function returns a char:    '0': the segment [ab] does not intersect (completely misses) the          bounding box surrounding the n-th triangle T.  It lies         strictly to one side of one of the six supporting planes.    '?': status unknown: the segment may or may not intersect T.*/char BoxTest ( int n, tPointi a, tPointi b ){   int i; /* Coordinate index */   int w;   for ( i=0; i < DIM; i++ ) {       w = Box[ n ][0][i]; /* min: lower left */       if ( (a[i] < w) && (b[i] < w) ) return '0';       w = Box[ n ][1][i]; /* max: upper right */       if ( (a[i] > w) && (b[i] > w) ) return '0';   }   return '?';}/* irint not available in some libraries, so... */int	irint( double x ){	return (int) rint( x );}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品免费av| 日韩午夜在线观看视频| 国产精品久久久久影院老司| 国产成人福利片| 国产视频亚洲色图| 岛国av在线一区| 国产精品久久午夜| 97久久精品人人澡人人爽| 国产精品久久毛片a| 成人av午夜电影| 中文字幕视频一区二区三区久| 成人av午夜影院| 亚洲精品国产高清久久伦理二区| 精品欧美乱码久久久久久| 日本亚洲免费观看| 欧美变态tickle挠乳网站| 久久精品免费观看| 久久精品免视看| 99久久精品一区| 亚洲高清不卡在线| 日韩免费看的电影| 风间由美一区二区av101| 亚洲三级小视频| 欧美三片在线视频观看| 蜜桃久久久久久久| 国产欧美一区二区在线| 色综合激情久久| 午夜精品久久久久久| 精品国产乱码久久| av电影在线不卡| 天天综合网天天综合色| 久久众筹精品私拍模特| 91在线精品一区二区| 日一区二区三区| 久久久高清一区二区三区| 日本道精品一区二区三区 | 精品久久一区二区| 成人成人成人在线视频| 午夜精品福利在线| 欧美激情一区不卡| 欧美三级在线视频| 国产精品18久久久| 午夜视频在线观看一区二区| 久久精品夜夜夜夜久久| 欧美日韩久久久一区| 国产精品亚洲午夜一区二区三区| 国产一区在线观看视频| 亚洲精品国产a| 久久久久久99精品| 在线成人av网站| 丰满白嫩尤物一区二区| 亚洲丰满少妇videoshd| 国产精品情趣视频| 久久一区二区三区四区| 欧美丝袜丝交足nylons图片| 国产精品18久久久久| 日日骚欧美日韩| 亚洲欧洲www| 久久亚洲综合色一区二区三区| 在线亚洲+欧美+日本专区| 国产乱人伦偷精品视频免下载| 天天综合色天天综合| 亚洲男人天堂av网| 中文一区一区三区高中清不卡| 欧美一区二区美女| 日本精品视频一区二区| 国产精品一级在线| 久久精品国产成人一区二区三区 | 国内精品写真在线观看| 午夜精品福利久久久| 亚洲精品你懂的| 国产三区在线成人av| 精品国产乱码久久久久久免费| 欧美日韩成人一区二区| 色欧美片视频在线观看在线视频| 国产高清不卡二三区| 精品在线免费视频| 麻豆精品国产传媒mv男同 | 日韩精品一级中文字幕精品视频免费观看 | www一区二区| 日韩一级高清毛片| 欧美一三区三区四区免费在线看 | 91久久一区二区| 91蜜桃视频在线| 99久久亚洲一区二区三区青草| 国产成人鲁色资源国产91色综 | 亚洲国产精品自拍| 午夜视频一区二区三区| 亚洲18色成人| 五月天国产精品| 天天色综合天天| 视频一区二区中文字幕| 天天做天天摸天天爽国产一区| 五月天网站亚洲| 秋霞午夜av一区二区三区| 喷白浆一区二区| 麻豆一区二区三区| 狠狠色综合色综合网络| 九九久久精品视频| 国产成人精品aa毛片| 99这里只有精品| 一本到不卡免费一区二区| 色天使久久综合网天天| 欧美三级电影一区| 欧美成人vr18sexvr| 精品福利视频一区二区三区| 久久嫩草精品久久久精品| 中文字幕亚洲成人| 性做久久久久久久久| 极品少妇一区二区| av资源站一区| 欧美日韩亚洲综合在线| 精品久久久久久亚洲综合网| 国产日韩v精品一区二区| 亚洲婷婷在线视频| 午夜亚洲福利老司机| 国产一区二区免费视频| 色综合久久88色综合天天6| 日韩一区国产二区欧美三区| 中文字幕乱码亚洲精品一区| 亚洲成人av资源| 国产精品亚洲午夜一区二区三区 | 日韩视频国产视频| 欧美日韩国产高清一区| 精品国免费一区二区三区| 久久综合色婷婷| 国产精品免费久久| 亚洲一二三四在线观看| 日韩高清不卡在线| 成人一区二区三区视频在线观看 | 欧洲国内综合视频| 91精品久久久久久久99蜜桃 | 成人免费看的视频| 欧美在线短视频| 精品国产第一区二区三区观看体验 | 欧美成人精精品一区二区频| 亚洲国产高清在线观看视频| 亚洲午夜免费福利视频| 日本怡春院一区二区| 国产麻豆日韩欧美久久| 91精选在线观看| 欧美国产日产图区| 亚洲高清中文字幕| 久久国产免费看| 99re热视频这里只精品| 久久色视频免费观看| 亚洲精品免费在线播放| 亚洲最新在线观看| 久久国内精品视频| 欧美欧美午夜aⅴ在线观看| 国产清纯在线一区二区www| 亚洲综合另类小说| 国产一区二三区| 欧美曰成人黄网| 国产精品污污网站在线观看| 亚洲成av人片一区二区梦乃| 99久久久免费精品国产一区二区| 日韩一区国产二区欧美三区| 亚洲人成7777| 国产精品白丝jk黑袜喷水| 欧美日韩精品一区二区三区蜜桃| 亚洲欧美日韩中文字幕一区二区三区| 久久精品免费看| 成人动漫一区二区| 精品福利一二区| 日韩中文字幕91| 91网站在线播放| 久久久久久电影| 免费观看日韩av| 欧美日韩一区久久| 亚洲男同性视频| 成人av在线电影| 国产欧美视频一区二区| 久久精品国产亚洲一区二区三区 | 国产日韩av一区| 久久福利视频一区二区| 欧美丝袜自拍制服另类| 国产精品激情偷乱一区二区∴| 成人亚洲一区二区一| 精品成人一区二区三区| 三级一区在线视频先锋 | 欧美丰满美乳xxx高潮www| 日韩毛片在线免费观看| 成人听书哪个软件好| 欧美三级视频在线| 亚洲第一综合色| 欧美性猛交xxxx乱大交退制版 | 亚洲综合在线视频| 成年人国产精品| 国产精品久久久久三级| 99热在这里有精品免费| 国产精品乱码一区二区三区软件| 国产高清在线观看免费不卡| xnxx国产精品| 国产一区二区视频在线| 亚洲欧洲日韩女同| 91美女片黄在线观看| 亚洲视频在线观看一区| 91网站最新网址| 国产精品理论片|