亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久国产精品72免费观看| 欧美日韩一级大片网址| 欧美性色aⅴ视频一区日韩精品| 欧美一区二区福利视频| 国产精品国产三级国产普通话三级 | 日韩欧美一级二级三级| 中文字幕在线观看一区| 国产成人亚洲综合色影视| 欧美性猛交xxxxxx富婆| 久久久久久久久一| 日韩主播视频在线| 色噜噜夜夜夜综合网| 国产精品福利电影一区二区三区四区| 麻豆国产精品一区二区三区 | 精品一区二区国语对白| 欧美在线观看视频一区二区三区| 欧美激情在线一区二区| 精品一区二区国语对白| 欧美日韩国产另类一区| 亚洲最大成人网4388xx| av亚洲精华国产精华| 日本一区二区视频在线| 国产在线看一区| 日韩精品一区二区三区中文不卡| 亚洲成人精品一区二区| 欧美自拍丝袜亚洲| 亚洲一区电影777| 91女厕偷拍女厕偷拍高清| 中文字幕一区在线观看视频| 国产成人精品三级麻豆| 国产日产欧美精品一区二区三区| 国内精品自线一区二区三区视频| 欧美成人一区二区三区片免费| 日韩av一级片| 日韩免费高清电影| 精品亚洲porn| 国产调教视频一区| 成人国产精品视频| 亚洲视频免费在线观看| 91丨porny丨中文| 亚洲一区二区不卡免费| 678五月天丁香亚洲综合网| 日本亚洲视频在线| 日韩精品自拍偷拍| 国产剧情一区二区| 欧美激情一区二区三区在线| 成人动漫精品一区二区| 一区二区三区在线看| 欧美日韩在线一区二区| 三级亚洲高清视频| 久久久精品影视| 成人av电影免费观看| 亚洲精品欧美综合四区| 欧美日韩中文精品| 美女久久久精品| 欧美激情在线一区二区三区| 日本电影欧美片| 日本欧美大码aⅴ在线播放| 精品国产乱码久久久久久闺蜜 | 日本欧美在线观看| 精品日韩欧美在线| 成人av免费网站| 亚洲图片自拍偷拍| 久久丝袜美腿综合| 在线区一区二视频| 免费黄网站欧美| 国产精品萝li| 欧美一区二区三区在线观看| 国产乱码精品1区2区3区| 亚洲欧美二区三区| 日韩精品一区二区三区在线播放| 白白色 亚洲乱淫| 午夜精品福利在线| 久久久久久久久久久久久夜| 91丨九色丨蝌蚪丨老版| 久久爱另类一区二区小说| 亚洲欧美在线aaa| 日韩色视频在线观看| av资源网一区| 九色porny丨国产精品| 亚洲永久精品大片| 国产欧美精品一区二区色综合| 欧美蜜桃一区二区三区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日本一区二区三区四区在线视频| 欧美日韩中文一区| 91丨九色丨尤物| 国产精选一区二区三区| 高清国产一区二区三区| 一二三区精品福利视频| 欧美国产精品专区| 精品国产乱码久久久久久久| 欧美精品v国产精品v日韩精品| 成人在线视频首页| 国产一区欧美一区| 美女视频黄免费的久久| 视频一区视频二区中文| 亚洲精品一二三| 国产精品理论在线观看| 久久精品亚洲国产奇米99| 欧美一区二区三区视频在线| 在线一区二区三区四区五区| 99久久免费精品高清特色大片| 国产精品99久| 麻豆成人免费电影| 日韩精品一二三四| 亚洲国产wwwccc36天堂| 一区二区三区在线观看视频| 亚洲免费在线看| 亚洲欧洲av在线| 国产精品欧美精品| 国产精品美女久久久久久2018| 亚洲精品在线一区二区| 精品区一区二区| 2014亚洲片线观看视频免费| 日韩美一区二区三区| 精品国产一区二区三区久久久蜜月| 欧美制服丝袜第一页| 欧美主播一区二区三区美女| 欧美性一级生活| 9191精品国产综合久久久久久| 欧美日韩一区二区电影| 在线成人av影院| 欧美一级二级三级蜜桃| 日韩欧美在线1卡| 精品乱人伦小说| 久久综合九色综合欧美亚洲| 国产人成一区二区三区影院| 久久蜜桃av一区精品变态类天堂 | 最新国产の精品合集bt伙计| 自拍偷拍亚洲综合| 亚洲欧美另类图片小说| 亚洲精品中文字幕在线观看| 午夜精品在线看| 久久精品国产99国产| 国产很黄免费观看久久| 91免费国产在线观看| 欧美日韩五月天| 欧美大片在线观看一区二区| 国产欧美精品日韩区二区麻豆天美| 中文字幕日本不卡| 亚洲高清久久久| 激情综合亚洲精品| av在线免费不卡| 欧美日韩国产成人在线免费| 久久综合久久综合九色| 日韩美女精品在线| 天天操天天色综合| 国产成人免费视频精品含羞草妖精 | 另类小说图片综合网| 国产很黄免费观看久久| 欧美亚洲高清一区| 久久奇米777| 亚洲gay无套男同| 国产成人精品午夜视频免费| 欧美日韩在线播放| 久久久国产精华| 亚洲123区在线观看| 国产揄拍国内精品对白| 欧美在线你懂的| 国产女人18毛片水真多成人如厕| 亚洲一区二区三区小说| 国内外成人在线| 欧美丝袜丝交足nylons图片| 国产女人18毛片水真多成人如厕 | 国产成人在线视频免费播放| 欧美探花视频资源| 欧美韩国日本综合| 蜜桃视频在线一区| 91女人视频在线观看| 国产亚洲一二三区| 美女视频黄久久| 欧美三级一区二区| 中文字幕日韩欧美一区二区三区| 全部av―极品视觉盛宴亚洲| 91美女福利视频| 久久一夜天堂av一区二区三区| 日韩专区欧美专区| 欧美日韩综合不卡| 亚洲精品免费视频| 成人a免费在线看| 国产色婷婷亚洲99精品小说| 老司机一区二区| 在线不卡欧美精品一区二区三区| 亚洲欧美日韩国产中文在线| 国产成人精品免费看| 久久网站热最新地址| 蜜臀av性久久久久蜜臀av麻豆| 欧美日韩一区不卡| 亚洲自拍欧美精品| 色妹子一区二区| 亚洲天堂网中文字| 99久久免费精品| 中文字幕一区二区三区视频| 成人中文字幕在线| 国产精品视频一区二区三区不卡| 国产激情视频一区二区三区欧美| 久久伊人中文字幕| 国产成人aaa| 《视频一区视频二区|