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

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

?? chull.c

?? 是Computational Geometry in C中的原程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*This code is described in "Computational Geometry in C" (Second Edition),Chapter 4.  It is not written to be comprehensible without the explanation in that book.Input: 3n integer coordinates for the points.Output: the 3D convex hull, in postscript with embedded comments        showing the vertices and faces.Compile: gcc -o chull chull.c (or simply: make)Written by Joseph O'Rourke, with contributions by   Kristy Anderson, John Kutcher, Catherine Schevon, Susan Weller.Last modified: May 2000Questions to orourke@cs.smith.edu.--------------------------------------------------------------------This code is Copyright 2000 by Joseph O'Rourke.  It may be freely redistributed in its entirety provided that this copyright notice is not removed.--------------------------------------------------------------------*/#include <stdio.h>#include <math.h>/*Define Boolean type */typedef	enum { FALSE, TRUE }	bool;/* Define vertex indices. */#define X   0#define Y   1#define Z   2/* Define structures for vertices, edges and faces */typedef struct tVertexStructure tsVertex;typedef tsVertex *tVertex;typedef struct tEdgeStructure tsEdge;typedef tsEdge *tEdge;typedef struct tFaceStructure tsFace;typedef tsFace *tFace;struct tVertexStructure {   int      v[3];   int	    vnum;   tEdge    duplicate;	        /* pointer to incident cone edge (or NULL) */   bool     onhull;		/* T iff point on hull. */   bool	    mark;		/* T iff point already processed. */   tVertex  next, prev;};struct tEdgeStructure {   tFace    adjface[2];   tVertex  endpts[2];   tFace    newface;            /* pointer to incident cone face. */   bool     delete;		/* T iff edge should be delete. */   tEdge    next, prev;};struct tFaceStructure {   tEdge    edge[3];   tVertex  vertex[3];   bool	    visible;	        /* T iff face visible from new point. */   tFace    next, prev;};/* Define flags */#define ONHULL   	TRUE#define REMOVED  	TRUE#define VISIBLE  	TRUE#define PROCESSED	TRUE#define SAFE		1000000		/* Range of safe coord values. *//* Global variable definitions */tVertex vertices = NULL;tEdge edges    	 = NULL;tFace faces    	 = NULL;bool debug = FALSE;bool check = FALSE;/* Function declarations */tVertex MakeNullVertex( void );void    ReadVertices( void );void    Print( void );void    SubVec( int a[3], int b[3], int c[3]);void    DoubleTriangle( void );void    ConstructHull( void );bool	AddOne( tVertex p );int     VolumeSign(tFace f, tVertex p);int 	Volumei( tFace f, tVertex p );tFace	MakeConeFace( tEdge e, tVertex p );void    MakeCcw( tFace f, tEdge e, tVertex p );tEdge   MakeNullEdge( void );tFace   MakeNullFace( void );tFace   MakeFace( tVertex v0, tVertex v1, tVertex v2, tFace f );void    CleanUp( tVertex *pvnext );void    CleanEdges( void );void    CleanFaces( void );void    CleanVertices( tVertex *pvnext );bool	Collinear( tVertex a, tVertex b, tVertex c );void    CheckEuler(int V, int E, int F );void	PrintPoint( tVertex p );void    Checks( void );void	Consistency( void );void	Convexity( void );void	PrintOut( tVertex v );void	PrintVertices( void );void	PrintEdges( void );void	PrintFaces( void );void	CheckEndpts ( void );void	EdgeOrderOnFaces ( void );#include "macros.h"/*-------------------------------------------------------------------*/main( int argc, char *argv[] ){  if ( argc > 1 && argv[1][0] == '-' ) {    if( argv[1][1] ==  'd' ) {      debug = TRUE;      check = TRUE;      fprintf( stderr, "Debug and check mode\n");    }    if( argv[1][1] == 'c' ) {      check = TRUE;      fprintf( stderr, "Check mode\n");    }  }  else if ( argc > 1 && argv[1][0] != '-' ) {    printf ("Usage:  %s -d[ebug] c[heck]\n", *argv );    printf ("x y z coords of vertices from stdin\n");    exit(1);  }     ReadVertices();   DoubleTriangle();   ConstructHull();   EdgeOrderOnFaces();   Print();}/*---------------------------------------------------------------------MakeNullVertex: Makes a vertex, nulls out fields.---------------------------------------------------------------------*/tVertex	MakeNullVertex( void ){   tVertex  v;      NEW( v, tsVertex );   v->duplicate = NULL;   v->onhull = !ONHULL;   v->mark = !PROCESSED;   ADD( vertices, v );   return v;}/*---------------------------------------------------------------------ReadVertices: Reads in the vertices, and links them into a circularlist with MakeNullVertex.  There is no need for the # of vertices to bethe first line: the function looks for EOF instead.  Sets the globalvariable vertices via the ADD macro.---------------------------------------------------------------------*/void	ReadVertices( void ){   tVertex  v;   int      x, y, z;   int	    vnum = 0;   while ( scanf ("%d %d %d", &x, &y, &z ) != EOF )  {      v = MakeNullVertex();      v->v[X] = x;      v->v[Y] = y;      v->v[Z] = z;      v->vnum = vnum++;      if ( ( abs(x) > SAFE ) || ( abs(y) > SAFE ) || ( abs(z) > SAFE ) ) {         printf("Coordinate of vertex below might be too large: run with -d flag\n");         PrintPoint(v);      }   }}/*---------------------------------------------------------------------Print: Prints out the vertices and the faces.  Uses the vnum indices corresponding to the order in which the vertices were input.Output is in PostScript format.---------------------------------------------------------------------*/void	Print( void ){   /* Pointers to vertices, edges, faces. */   tVertex  v;   tEdge    e;   tFace    f;   int xmin, ymin, xmax, ymax;   int a[3], b[3];  /* used to compute normal vector */   /* Counters for Euler's formula. */   int 	V = 0, E = 0 , F = 0;   /* Note: lowercase==pointer, uppercase==counter. */   /*-- find X min & max --*/   v = vertices;   xmin = xmax = v->v[X];   do {      if( v->v[X] > xmax ) xmax = v->v[X];      else	 if( v->v[X] < xmin ) xmin = v->v[X];      v = v->next;   } while ( v != vertices );	   /*-- find Y min & max --*/   v = vertices;   ymin = ymax = v->v[Y];   do {      if( v->v[Y] > ymax ) ymax = v->v[Y];      else	 if( v->v[Y] < ymin ) ymin = v->v[Y];      v = v->next;   } while ( v != vertices );	   /* PostScript header */   printf("%%!PS\n");   printf("%%%%BoundingBox: %d %d %d %d\n", 	  xmin, ymin, xmax, ymax);   printf(".00 .00 setlinewidth\n");   printf("%d %d translate\n", -xmin+72, -ymin+72 );   /* The +72 shifts the figure one inch from the lower left corner */   /* Vertices. */   v = vertices;   do {                                       if( v->mark ) V++;                 v = v->next;   } while ( v != vertices );   printf("\n%%%% Vertices:\tV = %d\n", V);   printf("%%%% index:\tx\ty\tz\n");   do {                                       printf( "%%%% %5d:\t%d\t%d\t%d\n", 	     v->vnum, v->v[X], v->v[Y], v->v[Z] );      v = v->next;   } while ( v != vertices );	   /* Faces. */   /* visible faces are printed as PS output */   f = faces;   do {      ++F;                                    f  = f ->next;   } while ( f  != faces );   printf("\n%%%% Faces:\tF = %d\n", F );   printf("%%%% Visible faces only: \n");   do {                 /* Print face only if it is visible: if normal vector >= 0 */      SubVec( f->vertex[1]->v, f->vertex[0]->v, a );      SubVec( f->vertex[2]->v, f->vertex[1]->v, b );	        if(( a[0] * b[1] - a[1] * b[0] ) >= 0 )      {	 printf("%%%% vnums:  %d  %d  %d\n", 		f->vertex[0]->vnum, 		f->vertex[1]->vnum, 		f->vertex[2]->vnum);	 printf("newpath\n");	 printf("%d\t%d\tmoveto\n", 		f->vertex[0]->v[X], f->vertex[0]->v[Y] );	 printf("%d\t%d\tlineto\n", 		f->vertex[1]->v[X], f->vertex[1]->v[Y] );	 printf("%d\t%d\tlineto\n", 		f->vertex[2]->v[X], f->vertex[2]->v[Y] );	 printf("closepath stroke\n\n");      }      f = f->next;   } while ( f != faces );   /* prints a list of all faces */   printf("%%%% List of all faces: \n");   printf("%%%%\tv0\tv1\tv2\t(vertex indices)\n");   do {      printf("%%%%\t%d\t%d\t%d\n",	     f->vertex[0]->vnum,	     f->vertex[1]->vnum,	     f->vertex[2]->vnum );      f = f->next;   } while ( f != faces );	   /* Edges. */	   e = edges;   do {      E++;      e = e->next;   } while ( e != edges );   printf("\n%%%% Edges:\tE = %d\n", E );   /* Edges not printed out (but easily added). */   printf("\nshowpage\n\n");   check = TRUE;   CheckEuler( V, E, F );}/*---------------------------------------------------------------------SubVec:  Computes a - b and puts it into c.---------------------------------------------------------------------*/void    SubVec( int a[3], int b[3], int c[3]){   int  i;   for( i=0; i < 2; i++ )      c[i] = a[i] - b[i];}/*--------------------------------------------------------------------- DoubleTriangle builds the initial double triangle.  It first finds 3  noncollinear points and makes two faces out of them, in opposite order. It then finds a fourth point that is not coplanar with that face.  The   vertices are stored in the face structure in counterclockwise order so  that the volume between the face and the point is negative. Lastly, the 3 newfaces to the fourth point are constructed and the data structures are cleaned up. ---------------------------------------------------------------------*/void    DoubleTriangle( void ){   tVertex  v0, v1, v2, v3, t;   tFace    f0, f1 = NULL;   tEdge    e0, e1, e2, s;   int      vol;	   /* Find 3 noncollinear points. */   v0 = vertices;   while ( Collinear( v0, v0->next, v0->next->next ) )      if ( ( v0 = v0->next ) == vertices )         printf("DoubleTriangle:  All points are Collinear!\n"), exit(0);   v1 = v0->next;   v2 = v1->next;	   /* Mark the vertices as processed. */   v0->mark = PROCESSED;   v1->mark = PROCESSED;   v2->mark = PROCESSED;      /* Create the two "twin" faces. */   f0 = MakeFace( v0, v1, v2, f1 );   f1 = MakeFace( v2, v1, v0, f0 );   /* Link adjacent face fields. */   f0->edge[0]->adjface[1] = f1;   f0->edge[1]->adjface[1] = f1;   f0->edge[2]->adjface[1] = f1;   f1->edge[0]->adjface[1] = f0;   f1->edge[1]->adjface[1] = f0;   f1->edge[2]->adjface[1] = f0;	   /* Find a fourth, noncoplanar point to form tetrahedron. */   v3 = v2->next;   vol = VolumeSign( f0, v3 );   while ( !vol )   {      if ( ( v3 = v3->next ) == v0 )          printf("DoubleTriangle:  All points are coplanar!\n"), exit(0);      vol = VolumeSign( f0, v3 );   }	   /* Insure that v3 will be the first added. */   vertices = v3;   if ( debug ) {      fprintf(stderr, "DoubleTriangle: finished. Head repositioned at v3.\n");      PrintOut( vertices );   }	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天综合日日夜夜精品| 色久优优欧美色久优优| 国产成都精品91一区二区三| 91丨porny丨在线| 日韩精品一区国产麻豆| 亚洲欧美国产77777| 麻豆国产欧美一区二区三区| 91麻豆免费视频| 久久日韩精品一区二区五区| 亚欧色一区w666天堂| 国产69精品一区二区亚洲孕妇| 欧美日韩中文精品| 亚洲婷婷在线视频| 国产成人av福利| 日韩视频一区二区三区在线播放| 亚洲精品亚洲人成人网 | 久久综合丝袜日本网| 亚洲制服欧美中文字幕中文字幕| 国产成人免费xxxxxxxx| 日韩免费看的电影| 日本女人一区二区三区| 欧美亚一区二区| 亚洲免费观看视频| 成人sese在线| 国产欧美精品一区| 国产精品夜夜嗨| 欧美变态tickle挠乳网站| 日韩国产精品91| 欧美日韩高清不卡| 石原莉奈在线亚洲二区| 欧美色视频在线| 亚洲一区二区视频在线观看| 欧美亚洲国产bt| 亚洲综合一区在线| 欧美性高清videossexo| 亚洲大片在线观看| 欧美精品亚洲二区| 久久99久久99| 日韩一区二区三区视频| 奇米影视一区二区三区| 91精品国产免费| 日本欧美在线观看| 精品国产a毛片| 国产成人亚洲精品青草天美| 亚洲国产岛国毛片在线| 99久久精品国产一区| 亚洲三级免费电影| 欧美性高清videossexo| 天堂影院一区二区| 91精品国产丝袜白色高跟鞋| 日本亚洲最大的色成网站www| 欧美一区二区三区免费在线看 | 亚洲色大成网站www久久九九| 一本一道久久a久久精品| 亚洲高清免费观看 | 欧美在线观看18| 亚洲一区二区三区中文字幕| 欧美高清视频www夜色资源网| 免费xxxx性欧美18vr| 国产日韩欧美一区二区三区综合| 成人激情动漫在线观看| 一区二区在线观看不卡| 欧美一区三区四区| 国产成人av一区二区三区在线| 亚洲精品一二三| 欧美一二三区在线观看| 懂色av一区二区夜夜嗨| 香蕉乱码成人久久天堂爱免费| 久久免费国产精品| 在线观看免费成人| 国内精品伊人久久久久av影院 | 久久久久久久久免费| 91污在线观看| 久久99精品国产麻豆婷婷| 中文无字幕一区二区三区| 欧美三级视频在线| 国产成人精品影视| 图片区小说区区亚洲影院| 国产精品麻豆一区二区| 欧美一区二区大片| 色婷婷久久久综合中文字幕| 久久er99热精品一区二区| 亚洲精品视频免费看| 久久综合中文字幕| 欧美欧美欧美欧美首页| 成人免费福利片| 久久精品国产**网站演员| 亚洲欧美日韩在线不卡| 国产女主播视频一区二区| 91精品久久久久久久99蜜桃| 97久久精品人人做人人爽50路| 九色综合国产一区二区三区| 亚洲一区二区三区视频在线播放| 亚洲国产精品二十页| 精品卡一卡二卡三卡四在线| 欧美日韩精品欧美日韩精品 | 美腿丝袜亚洲色图| 亚洲国产精品一区二区久久| 成人欧美一区二区三区黑人麻豆| 精品久久免费看| 欧美电影免费观看完整版| 欧美日韩不卡在线| 欧美亚洲综合色| 色94色欧美sute亚洲线路二 | 欧美一区二区福利在线| 18成人在线观看| 欧美亚洲愉拍一区二区| 美国十次综合导航| 亚洲成a人v欧美综合天堂下载| 欧美日韩国产一级| 久久不见久久见免费视频7| 日本一区二区免费在线观看视频| 成人免费毛片app| 肉色丝袜一区二区| 色成年激情久久综合| 极品少妇xxxx精品少妇偷拍| 日韩成人精品视频| 国产精品国产三级国产a| heyzo一本久久综合| 国产在线播精品第三| 丝袜亚洲精品中文字幕一区| 亚洲风情在线资源站| 午夜在线成人av| 三级精品在线观看| 美女视频免费一区| 国内成人精品2018免费看| 狠狠色丁香婷婷综合久久片| 国产伦理精品不卡| 丁香六月综合激情| 91麻豆高清视频| 欧美视频完全免费看| 欧美日韩国产精选| 日韩欧美国产精品| 国产欧美日韩另类视频免费观看| 国产欧美日产一区| 亚洲黄一区二区三区| 日韩国产精品91| 国产精品综合网| 色婷婷国产精品综合在线观看| 欧美无乱码久久久免费午夜一区| 欧美精品三级在线观看| 精品久久久网站| 亚洲色图都市小说| 天天爽夜夜爽夜夜爽精品视频| 精一区二区三区| 99久久精品免费看国产免费软件| 欧美亚洲一区二区三区四区| 欧美一卡二卡三卡四卡| 日本一区二区三区国色天香| 亚洲精品日产精品乱码不卡| 日韩av在线免费观看不卡| 国产成人av电影在线观看| 在线观看亚洲a| 久久久久免费观看| 亚洲国产综合色| 国产精品66部| 欧美日韩一区二区在线观看| 欧美精品一区二区在线播放| 亚洲色图丝袜美腿| 激情综合色播五月| 欧美在线视频日韩| 国产肉丝袜一区二区| 亚洲成人av在线电影| av中文字幕亚洲| 日韩免费高清av| 亚洲激情一二三区| 粉嫩aⅴ一区二区三区四区 | 国产亚洲精品bt天堂精选| 亚洲伊人色欲综合网| 国产经典欧美精品| 欧美一区在线视频| 亚洲一区自拍偷拍| 日韩主播视频在线| 成人av在线影院| 日本中文字幕一区二区有限公司| 91精品国产综合久久福利软件| 综合久久给合久久狠狠狠97色| 国产电影精品久久禁18| 欧美一级在线免费| 亚洲一区二三区| 3atv在线一区二区三区| 亚洲天堂福利av| 国产精品综合一区二区| 久久久久久久电影| 成人福利电影精品一区二区在线观看 | 天天影视网天天综合色在线播放| 国产suv精品一区二区三区| 制服丝袜一区二区三区| 亚洲福利一二三区| 欧洲精品在线观看| 亚洲丝袜美腿综合| 成人精品国产一区二区4080| 久久久av毛片精品| 国产曰批免费观看久久久| 精品免费日韩av| 麻豆久久久久久| 26uuu国产电影一区二区| 美女一区二区视频| 日韩精品资源二区在线| 免费成人av在线|