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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? inpoly.c

?? 非常好的一本書 Computational Geometry in C 書中的源代碼 點與多變形的各種關(guān)系計算
?? C
字號:
/*This code is described in "Computational Geometry in C" (Second Edition),Chapter 7.  It is not written to be comprehensible without the explanation in that book.This program reads a polygon P followed by query points from stdin.The input format is:	n	x0 y0	x1 y1 	...	xn-1 yn-1	qx qy	qx qy	qx qy	...For each query point q, InPoly returns one of four char's:	i : q is strictly interior to P	o : q is strictly exterior to P	v : q is a vertex of P	e : q lies on the relative interior of an edge of PThese represent mutually exclusive categories.For an explanation of the code, see Chapter 7 of "Computational Geometry in C (Second Edition)."Written by Joseph O'Rourke, contributions by Min Xu, June 1997.Questions to orourke@cs.smith.edu.--------------------------------------------------------------------This code is Copyright 1998 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	X	0#define	Y	1typedef	enum { FALSE, TRUE }	bool;#define DIM     2               /* Dimension of points */typedef int     tPointi[DIM];   /* type integer point */typedef double  tPointd[DIM];   /* type double point */#define PMAX    10000           /* Max # of pts in polygon */   typedef tPointi tPolygoni[PMAX];/* type integer polygon */char	InPoly( tPointi q, tPolygoni P, int n );void	PrintPoly( int n, tPolygoni P );void	PrintPoint( tPointi p );void    Copy ( tPolygoni a, tPolygoni b , int n );main(){  int		n;  tPolygoni	P, Porig;  tPointi	q;    n = ReadPoly( P );  Copy( P, Porig, n );  while( scanf( "%d %d", &q[X], &q[Y]) != EOF ) {    printf( "InPoly (%3d, %3d) = %c\n", q[X], q[Y], InPoly( q, P, n ) );    /* Refill the destroyed polygon with original. */    Copy( Porig, P, n );         }}/*InPoly returns a char in {i,o,v,e}.  See above for definitions.*/char InPoly( tPointi q, tPolygoni P, int n ){  int	 i, i1;      /* point index; i1 = i-1 mod n */  int	 d;          /* dimension index */  double x;          /* x intersection of e with ray */  int	 Rcross = 0; /* number of right edge/ray crossings */  int    Lcross = 0; /* number of left edge/ray crossings */  printf("\n==>InPoly: q = "); PrintPoint(q); putchar('\n');    /* Shift so that q is the origin. Note this destroys the polygon.     This is done for pedogical clarity. */  for( i = 0; i < n; i++ ) {    for( d = 0; d < DIM; d++ )      P[i][d] = P[i][d] - q[d];  }	  /* For each edge e=(i-1,i), see if crosses ray. */  for( i = 0; i < n; i++ ) {    /* First see if q=(0,0) is a vertex. */    if ( P[i][X]==0 && P[i][Y]==0 ) return 'v';    i1 = ( i + n - 1 ) % n;    printf("e=(%d,%d)\t", i1, i);        /* if e "straddles" the x-axis... */    /* The commented-out statement is logically equivalent to the one        following. */    /* if( ( ( P[i][Y] > 0 ) && ( P[i1][Y] <= 0 ) ) ||       ( ( P[i1][Y] > 0 ) && ( P[i] [Y] <= 0 ) ) ) { */        if( ( P[i][Y] > 0 ) != ( P[i1][Y] > 0 ) ) {            /* e straddles ray, so compute intersection with ray. */      x = (P[i][X] * (double)P[i1][Y] - P[i1][X] * (double)P[i][Y])	/ (double)(P[i1][Y] - P[i][Y]);      printf("straddles: x = %g\t", x);            /* crosses ray if strictly positive intersection. */      if (x > 0) Rcross++;    }    printf("Right cross=%d\t", Rcross);        /* if e straddles the x-axis when reversed... */    /* if( ( ( P[i] [Y] < 0 ) && ( P[i1][Y] >= 0 ) ) ||       ( ( P[i1][Y] < 0 ) && ( P[i] [Y] >= 0 ) ) )  { */        if ( ( P[i][Y] < 0 ) != ( P[i1][Y] < 0 ) ) {             /* e straddles ray, so compute intersection with ray. */      x = (P[i][X] * (double)P[i1][Y] - P[i1][X] * (double)P[i][Y])          / (double)(P[i1][Y] - P[i][Y]);      printf("straddles: x = %g\t", x);      /* crosses ray if strictly positive intersection. */      if (x < 0) Lcross++;    }    printf("Left cross=%d\n", Lcross);  }	    /* q on the edge if left and right cross are not the same parity. */  if( ( Rcross % 2 ) != (Lcross % 2 ) )    return 'e';    /* q inside iff an odd number of crossings. */  if( (Rcross % 2) == 1 )    return 'i';  else	return 'o';}void PrintPoint( tPointi p ){  int	i;    putchar('(');  for ( i = 0; i < DIM; i++ ) {    printf("%d", p[i]);    if ( i != DIM-1 ) putchar(',');  }  putchar(')');}/*   Reads in the coordinates of the vertices of a polygon from stdin,   puts them into P, and returns n, the number of vertices.   Formatting conventions: etc.   */int ReadPoly( tPolygoni P ){  int	i, n;    do {    printf( "Input the number of vertices:\n");    scanf( "%d", &n );    if ( n <= PMAX )      break;    printf("Error in read_poly:  too many points; max is %d\n", PMAX);  }  while ( 1 );  printf( "Polygon:\n" );  printf( "   i   x   y\n");  for ( i = 0; i < n; i++ ) {    scanf( "%d %d", &P[i][0], &P[i][1] );    printf("%3d%4d%4d\n", i, P[i][0], P[i][1]);  }  printf("n = %3d vertices read\n",n);  putchar('\n');  return n;}void PrintPoly( int n, tPolygoni P ){  int	i;    printf("Polygon:\n");  printf("  i   x   y\n");  for( i = 0; i < n; i++ )    printf("%3d%4d%4d\n", i, P[i][0], P[i][1]);}/* Copy polygon a to b (overwriting b). */void Copy( tPolygoni a, tPolygoni b, int n ){  int i, j;    for ( i=0; i < n; i++)    for ( j = 0; j < DIM; j++ )      b[i][j] = a[i][j];}bool EqPoint( tPointi a, tPointi b ){  int     i;  for ( i = 0; i < DIM; i++ )    if ( a[i] != b[i])      return  FALSE;  return  TRUE;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色偷偷88欧美精品久久久| 精品无码三级在线观看视频| 国产一区不卡视频| 亚洲一卡二卡三卡四卡| 国产精品亚洲午夜一区二区三区| 在线观看亚洲专区| 国产欧美一区视频| 久久精品国产99久久6| 在线免费观看一区| 国产精品素人视频| 蜜桃av一区二区| 欧美男男青年gay1069videost| 国产精品污网站| 国产一区免费电影| 日韩视频在线永久播放| 午夜婷婷国产麻豆精品| 色呦呦日韩精品| 中文字幕av一区二区三区高| 国内欧美视频一区二区| 7777精品伊人久久久大香线蕉最新版| 椎名由奈av一区二区三区| 国产大陆a不卡| 精品国产乱码久久| 久久精工是国产品牌吗| 51精品秘密在线观看| 亚洲激情图片小说视频| 91婷婷韩国欧美一区二区| 中文一区一区三区高中清不卡| 精品亚洲成a人在线观看| 欧美一卡二卡三卡四卡| 日韩制服丝袜av| 欧美日韩二区三区| 亚洲第一会所有码转帖| 欧洲一区在线观看| 亚洲欧洲日本在线| 成人免费高清在线| 中文字幕一区二区三| 成人免费看片app下载| 国产精品萝li| 成人黄色软件下载| 国产精品不卡在线| 99国产麻豆精品| 亚洲精品免费电影| 在线观看成人小视频| 亚洲图片有声小说| 精品视频色一区| 午夜精品久久一牛影视| 欧美日韩mp4| 男人的天堂久久精品| 欧美一个色资源| 六月婷婷色综合| 精品免费视频一区二区| 国产成人综合在线播放| 久久久久青草大香线综合精品| 久久一日本道色综合| 国产·精品毛片| 国产精品久久网站| 色综合久久综合| 亚洲成在线观看| 日韩一区二区三区视频| 精品无人区卡一卡二卡三乱码免费卡| 精品国产123| 懂色av中文一区二区三区| 国产精品久久久久永久免费观看 | 亚洲成人福利片| 3d成人动漫网站| 国产综合一区二区| 国产精品丝袜91| 在线观看亚洲精品| 裸体在线国模精品偷拍| 国产欧美日韩亚州综合| 91视频观看免费| 人人精品人人爱| 久久久久久久久免费| 91丨porny丨首页| 日韩不卡一区二区| 国产日韩视频一区二区三区| 91精品1区2区| 日本亚洲欧美天堂免费| 日本一区二区电影| 色88888久久久久久影院按摩| 婷婷国产在线综合| 久久久久久电影| 色乱码一区二区三区88| 麻豆精品一区二区| 国产精品的网站| 欧美日韩国产综合久久| 国内精品视频666| 亚洲九九爱视频| 欧美精品一区在线观看| 91亚洲国产成人精品一区二三| 婷婷中文字幕综合| 久久精品视频在线免费观看| 在线一区二区视频| 国产主播一区二区| 亚洲综合激情小说| 久久久久国产精品厨房| 欧美性猛交一区二区三区精品| 国模大尺度一区二区三区| 亚洲美女在线一区| 久久免费精品国产久精品久久久久| 一本大道av伊人久久综合| 韩国一区二区三区| 亚洲影院久久精品| 国产人成一区二区三区影院| 欧美性猛交xxxxxxxx| 国产精品一区二区你懂的| 天天做天天摸天天爽国产一区 | 中文字幕国产一区| 91精品啪在线观看国产60岁| 成人福利视频网站| 蜜臀91精品一区二区三区| 亚洲精品一二三区| 国产亚洲一本大道中文在线| 欧美绝品在线观看成人午夜影视| 成年人网站91| 国产一区 二区| 午夜精品久久久久久久久久| 最近中文字幕一区二区三区| 欧美成人精精品一区二区频| 欧美揉bbbbb揉bbbbb| 一区在线播放视频| 久久久久国产精品人| 日韩视频免费观看高清完整版| 色哟哟亚洲精品| 国产精品 欧美精品| 久久爱www久久做| 午夜精品久久久久久| 亚洲欧美一区二区三区久本道91| 国产欧美日韩在线观看| 精品国产乱子伦一区| 欧美顶级少妇做爰| 欧美自拍偷拍一区| zzijzzij亚洲日本少妇熟睡| 国内久久精品视频| 青青草成人在线观看| 亚洲午夜羞羞片| 亚洲黄色小视频| 最新国产成人在线观看| 国产精品丝袜在线| 国产亚洲成年网址在线观看| 欧美成人a视频| 日韩欧美的一区| 日韩欧美色综合网站| 日韩一区二区三| 91精品国产全国免费观看| 欧美日本视频在线| 欧美伊人久久大香线蕉综合69| 色视频成人在线观看免| 久久久99精品免费观看| 日本韩国一区二区三区视频| 成人a区在线观看| 国产成人精品免费网站| 国产一区二区在线观看免费| 美女一区二区三区在线观看| 琪琪久久久久日韩精品| 日韩一区精品字幕| 三级久久三级久久| 日韩二区三区四区| 日本麻豆一区二区三区视频| 日韩成人精品在线观看| 美国三级日本三级久久99| 日本三级韩国三级欧美三级| 日本成人在线网站| 久久精品二区亚洲w码| 国产一区不卡视频| 大胆亚洲人体视频| av色综合久久天堂av综合| 色哟哟在线观看一区二区三区| 91黄色在线观看| 欧美日本精品一区二区三区| 欧美片网站yy| 精品国产在天天线2019| 国产亚洲短视频| 国产精品久久久久久久久快鸭 | 亚洲欧美一区二区久久| 亚洲欧美日韩中文字幕一区二区三区| 亚洲欧美日韩国产综合| 色视频一区二区| 欧美丰满高潮xxxx喷水动漫 | 国产1区2区3区精品美女| 成人的网站免费观看| 91久久国产最好的精华液| 欧美日韩www| 久久综合九色综合欧美就去吻| 国产丝袜欧美中文另类| 日韩理论片一区二区| 亚洲福中文字幕伊人影院| 久久精品久久综合| 成人免费av网站| 在线免费一区三区| 日韩欧美激情在线| 欧美国产一区二区在线观看 | 国产日韩综合av| 亚洲精品国产视频| 三级精品在线观看| 国产一区二区毛片| 91视频精品在这里| 欧美大片免费久久精品三p| 欧美国产成人精品|