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

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

?? mathsubs.cpp

?? 連接oracle
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
#include "stdafx.h"
//#include "CubSurface.h"
#include "drawcli.h"
#include "math.h"
#include "SideLine.h"
//#define MIN_DISTANCE	10		//最小跨度

/*
	判斷“點(diǎn)”是否在任意多邊形內(nèi):
	

	本算法采用射線追蹤法:
	
	  過待測(cè)點(diǎn)的一條射線與多邊形邊的交點(diǎn)的個(gè)數(shù),若為奇數(shù),則在
	多邊形內(nèi),否則為外部。

	實(shí)際上,我們只關(guān)心交點(diǎn)個(gè)數(shù),沒必要真正求出射線與邊的交點(diǎn)。
	改進(jìn)的射線與邊判斷是否相交的方法如下:
	
	被檢測(cè)的點(diǎn)P(x,y)向y= -∞方向作射線。對(duì)邊PiPi+1按以下順序檢測(cè):


	若(y>=yi and  y>=yi+1)		//邊在被測(cè)點(diǎn)P的下方
	{
		//在左右之間或過右端點(diǎn):
		若( xi<x 且 x<=xi+1 ) 或 ( xi+1<x 且 x<=xi ) )
			射線與邊相交。
	}
	else 若(y>=yi ||  y>=yi+1) //被測(cè)點(diǎn)P在邊的上、下之間
	{

		//在左右之間或過右端點(diǎn):
		若( (xi<x 且 x<=xi+1 ) 或 ( xi+1<x 且 x<=xi ) )
		{
			求射線(垂線)與邊的交點(diǎn)yc
			若yc<=y
				射線與邊相交。
		}
	}

*/

BOOL insideEx(float *XPV, float *YPV, int N,  double x, double y, int &LOCP)
{
	if (N<3) return 0;
	float xi,yi, xj,yj;
	xi = XPV[N-1];
	yi = YPV[N-1];
	
	int p=0;
	
	LOCP = 0;

	for (int i=0; i<N; i++)
	{
		xj = XPV[i];
		yj = YPV[i];

		if (y>=yi && y>=yj)   //點(diǎn)在上面 
		{
			//在左右方向之間或過右邊頂點(diǎn)(線段其它部分在左邊)
			if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				p++;
			}
			if (y==yi && y==yj)	LOCP = 1;

		}
		else  if (y>=yi || y>=yj)   //點(diǎn)在上、下之間
		{
			if (xi==xj && x==xi)	//在垂線上
			{
				LOCP = 1;
				p++;
			}
			else if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				//計(jì)算射線(垂直向下的直線)與邊的交點(diǎn):
				//由邊的直線方程:yc = y1+(xc-x1)*(y1-y2)/(x1-x2);
				//令xc為待測(cè)點(diǎn)x
				double yd = yi+(x-xi)*(yi-yj)/(xi-xj);
				if (yd<=y)
				{
					if (yd==y) LOCP = 1;

					p++;
				}
			}

		}
		xi = xj;
		yi = yj;
	}

	return  (p & 1);
	
}
//整數(shù)數(shù)組的實(shí)現(xiàn):

BOOL insideEx(int *XPV, int *YPV, int N,  int x, int y, int &LOCP)
{
	if (N<3) return 0;

	int xi,yi, xj,yj;

	xi = XPV[N-1];
	yi = YPV[N-1];
	
	int p=0;
	
	LOCP = 0;

	for (int i=0; i<N; i++)
	{
		xj = XPV[i];
		yj = YPV[i];

		if (y>=yi && y>=yj)   //點(diǎn)在上面 
		{
			//在左右方向之間或過右邊頂點(diǎn)(線段其它部分在左邊)
			if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				p++;
			}
			if (y==yi && y==yj)	LOCP = 1;

		}
		else  if (y>=yi || y>=yj)   //點(diǎn)在上、下之間
		{
			if (xi==xj && x==xi)	//在垂線上
			{
				LOCP = 1;
				p++;
			}
			else if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				//計(jì)算射線(垂直向下的直線)與邊的交點(diǎn):
				//由邊的直線方程:yc = y1+(xc-x1)*(y1-y2)/(x1-x2);
				//令xc為待測(cè)點(diǎn)x
				float yd = yi+(float)(x-xi)*(yi-yj)/(xi-xj);
				if (yd<=y)
				{
					if (yd==y) LOCP = 1;

					p++;
				}
			}

		}
		xi = xj;
		yi = yj;
	}

	return  (p & 1);
	
}


//點(diǎn)數(shù)組的實(shí)現(xiàn):

BOOL insideEx(CPoint *XYP, int N,  int x, int y, int &LOCP)
{
	if (N<3) return 0;

	int xi,yi, xj,yj;

	xi = XYP[N-1].x;
	yi = XYP[N-1].y;
	
	int p=0;
	
	LOCP = 0;

	for (int i=0; i<N; i++)
	{
		xj = XYP[i].x;
		yj = XYP[i].y;

		if (y>=yi && y>=yj)   //點(diǎn)在上面 
		{
			//在左右方向之間或過右邊頂點(diǎn)(線段其它部分在左邊)
			if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				p++;
			}
			if (y==yi && y==yj)	LOCP = 1;

		}
		else  if (y>=yi || y>=yj)   //點(diǎn)在上、下之間
		{
			if (xi==xj && x==xi)	//在垂線上
			{
				LOCP = 1;
				p++;
			}
			else if ( ( xi<x && x<=xj ) || ( xj<x && x<=xi)  )
			{
				//計(jì)算射線(垂直向下的直線)與邊的交點(diǎn):
				//由邊的直線方程:yc = y1+(xc-x1)*(y1-y2)/(x1-x2);
				//令xc為待測(cè)點(diǎn)x
				float yd = yi+(float)(x-xi)*(yi-yj)/(xi-xj);
				if (yd<=y)
				{
					if (yd==y) LOCP = 1;

					p++;
				}
			}

		}
		xi = xj;
		yi = yj;
	}

	return  (p & 1);
	
}

//計(jì)算曲線的長(zhǎng)度(整數(shù)):
double calcLength(int *x, int *y, int n)
{
	int l;
 	double   lm;

	lm = 0; 
	 
	for (l=0; l<n-1; l++)
	{
 		lm = lm + sqrt( (double)(x[l+1]-x[l])*(x[l+1]-x[l])
			    +       (double)(y[l+1]-y[l])*(y[l+1]-y[l]) );
	}
	return lm;	
 
}

//計(jì)算曲線的長(zhǎng)度(浮點(diǎn)):

double calcLength(float *x, float *y, int n)
{
	int l;
 	double   lm;

	lm = 0; 
	 
	for (l=0; l<n-1; l++)
	{
 		lm = lm + sqrt( (x[l+1]-x[l])*(x[l+1]-x[l])
			    +       (y[l+1]-y[l])*(y[l+1]-y[l]) );
	}
	return lm;	
 
}

 
//判斷是否相交(數(shù)學(xué)意義的直線)
int testCrossed(float xa, float ya, float xb, float yb,
				float xA, float yA, float xB, float yB,
				float &xc, float &yc)
{

	double A1 = ya-yb;
	double B1 = xb-xa;
	double C1 = -xa*A1-ya*B1;

	double A2 = yA-yB;
	double B2 = xB-xA;
	double C2 = -xA*A2-yA*B2;

	double CC=A2*B1-A1*B2;
	if (CC==0) return 0;

	xc = (float)((B2*C1-B1*C2)/CC);
	yc = (float)((A1*C2-A2*C1)/CC);

	return 1;
}

//判斷是否相交于第一條直線:
int testCross1( float xa, float ya, float xb, float yb,
				float xA, float yA, float xB, float yB,
				float &xc, float &yc)
{

	if (! testCrossed(	xa, ya, xb, yb, xA, yA, xB, yB, xc, yc)) return 0;
	
	//是否落在第一條線上
	if (xa<xb)
	{
		if ( xc<xa ||  xc>xb) return 0;
	}
	else
	{
		if ( xc>xa ||  xc<xb) return 0;
	}
	if (ya<yb)
	{
		if ( yc<ya ||  yc>yb) return 0;
	}
	else
	{
		if ( yc>ya ||  yc<yb) return 0;
	}
	return 1;
}

//判斷是否相交于第二條直線
int testCross2( float xa, float ya, float xb, float yb,
				float xA, float yA, float xB, float yB,
				float &xc, float &yc)
{
	if (! testCrossed(	xa, ya, xb, yb, xA, yA, xB, yB, xc, yc)) return 0;


	//是否落在第二條線上
	if (xA<xB)
	{
		if ( xc<xA ||  xc>xB) return 0;
	}
	else
	{
		if ( xc>xA ||  xc<xB) return 0;
	}
	if (yA<yB)
	{
		if ( yc<yA ||  yc>yB) return 0;
	}
	else
	{
		if ( yc>yA ||  yc<yB) return 0;
	}

	return 1;
}


//判斷是否相交點(diǎn)在二條直線上:
int testCross(	float xa, float ya, float xb, float yb,
				float xA, float yA, float xB, float yB,
				float &xc, float &yc)
{
	 
	if (! testCrossed(	xa, ya, xb, yb, xA, yA, xB, yB,  xc, yc)) return 0;

	if (xa<xb)
	{
		if (xc<xa || xc>xb) return 0;
	}
	else
	{
		if (xc>xa || xc<xb) return 0;
	}
	if (ya<yb)
	{
		if (yc<ya || yc>yb) return 0;
	}
	else
	{
		if (yc>ya || yc<yb) return 0;
	}

	if (xA<xB)
	{
		if (xc<xA || xc>xB) return 0;
	}
	else
	{
		if (xc>xA || xc<xB) return 0;
	}
	if (yA<yB)
	{
		if (yc<yA || yc>yB) return 0;
	}
	else
	{
		if (yc>yA || yc<yB) return 0;
	}
 
	return 1;
}

//判斷是否相交點(diǎn)在二條直線上:
int testCross(	long xa, long ya, long xb, long yb,
			  long xA, long yA, long xB, long yB,
			  long &xc, long &yc)
{
	float _xc = (float)xc;
	float _yc = (float)yc;
	return testCross((float)xa, (float)ya, (float)xb, (float)yb,
		(float)xA, (float)yA, (float)xB, (float)yB,
		_xc,_yc);
}

//直線是否與多邊型相交:
int crossXY(float *x, float *y, 
			float X, float Y,
			float X1,float Y1,
			float &XC, float &YC, int np)
{
	//判斷是否相交于在二條直線上:
	for (int i=0; i<np; i++)
	{
		int t= testCross(
			x[i],	y[i],
			x[i+1], y[i+1],
			X,  Y,
			X1, Y1,
	 		XC, YC);
		if (t) return 1;
	}
	return 0;

}

/*
	判斷一個(gè)點(diǎn),是否與一條曲線(多線段)的垂直交線的交點(diǎn),落在該曲線上.
	
	一個(gè)約束條件是,點(diǎn)到各個(gè)線段的距離(垂直距離)要小于給定的值。
*/
BOOL isVCrossAtLine(CPoint po, CPoint ps[], int nps, int &smin, int &ipos,
					double &x0,  double &y0)
{
	CPoint p1,p2;
	double A2,B2,C2;
	double s;
	double xk;
	
	double A,B,C;
	
	int issel = 0;

	nps--;

	for (int j=0; j<nps; j++)
	{
		p1 = ps[j];
		p2 = ps[j+1];

		A =  p1.y - p2.y;
		B =  p2.x - p1.x;	
		if (A==0 && B==0)
		{
			if (po.x == p1.x && po.y==p1.y)
			{
				ipos = j;
				return true;
			}
			continue;
		}

		C = -p1.x*A - p1.y*B;

		//點(diǎn)到直線的距離:
		s = fabs(A*po.x + B*po.y +C)/sqrt( B*B+ A*A);
 
		if (s>=smin ) continue;
	
		if (A==0) //水平線段,則過鼠標(biāo)點(diǎn)的垂線為垂直線
		{
			x0 = po.x;
			y0 = p1.y;

			if (p1.x < p2.x)
			{
				if (po.x<p1.x || po.x>p2.x)
 					continue;
			}
			else
			{
				if (po.x<p2.x || po.x>p1.x)
					continue;
			}

			ipos = j;
			smin  = (int)s;		
			issel = true;
		}
		else if (B==0)
		{
			x0 = p1.x;
			y0 = po.y;
			
			if (p1.y < p2.y)
			{
				if (po.y<p1.y || po.y>p2.y)
					continue;
			}
			else
			{
				if (po.y<p2.y || po.y>p1.y)
					continue;
			}

			ipos = j;
			smin  = (int)s;		
			issel = true;
		}
		else
		{

			//點(diǎn)斜式
			xk = (float)B/A; 
			A2 = xk;
			B2 = -1;
			C2 = po.y - xk * po.x;

			x0 = - (C *B2-C2*B )/(A *B2-A2*B );
			y0 = - (C2*A -C *A2)/(A *B2-A2*B );

			if (p1.x < p2.x)
			{
				if (x0<p1.x || x0>p2.x)
					continue;
			}
 			else
			{
				if (x0<p2.x || x0>p1.x)
					continue;
			}
			if (p1.y < p2.y)
			{
				if (y0<p1.y || y0>p2.y)
					continue;
			}
			else
			{
				if (y0<p2.y || y0>p1.y)
					continue;
			}

			ipos = j;
 			smin = (int)s;		
			issel = true;
		 
		}	//end of dip-line


	}	//end for

	return issel;

}


/*
	分離的X,Y整數(shù)數(shù)組版本
*/
BOOL isVCrossAtLine(int pox, int poy, int psx[], int psy[],
					int nps, int &smin, int &ipos,
						double &x0,  double &y0)
{
	int p1x, p1y;
	int p2x, p2y;

	double A2,B2,C2;
	double s;
	double xk;
	
	double A,B,C;
	
	int issel = 0;

	nps--;
 
	for (int j=0; j<nps; j++)
	{
		p1x = psx[j];
		p1y = psy[j];

		p2x = psx[j+1];
		p2y = psy[j+1];

		A =  p1y - p2y;
		B =  p2x - p1x;
		
		if (A==0 && B==0)
		{
			if (pox == p1x && poy==p1y)
			{
				ipos = j;
				smin = 0;
				return true;
			}
			continue;
		}

		C = -p1x*A - p1y*B;

		//點(diǎn)到直線的距離:
		s = fabs(A*pox + B*poy +C)/sqrt( B*B+ A*A);
 
		if (s>=smin ) continue;
		if (A==0) //水平線段,則過鼠標(biāo)點(diǎn)的垂線為垂直線
		{
			x0 = pox;
			y0 = p1y;


			if (p1x < p2x)
			{
				if (pox<p1x || pox>p2x)
 					continue;
			}
			else
			{
				if (pox<p2x || pox>p1x)
					continue;
			}

			ipos = j;
			smin  = (int)s;		
			issel = true;
		}
		else if (B==0)
		{
			x0 = p1x;
			y0 = poy;

			
			if (p1y < p2y)
			{
				if (poy<p1y || poy>p2y)
					continue;
			}
			else
			{
				if (poy<p2y || poy>p1y)
					continue;
			}

			ipos = j;
			smin  = (int)s;		
			issel = true;
		}
		else
		{

			//點(diǎn)斜式
			xk = B/A; 
			A2 = xk;
			B2 = -1;
			C2 = poy - xk * pox;

			if (A *B2-A2*B==0)
			{
				j=j;
			}

			x0 = - (C *B2-C2*B )/(A *B2-A2*B );
			y0 = - (C2*A -C *A2)/(A *B2-A2*B );

 
			if (p1x < p2x)
			{
				if (x0<p1x || x0>p2x)
					continue;
			}
 			else
			{
				if (x0<p2x || x0>p1x)
					continue;
			}
			if (p1y < p2y)
			{
				if (y0<p1y || y0>p2y)
					continue;
			}
			else
			{
				if (y0<p2y || y0>p1y)
					continue;
			}

			ipos = j;
 			smin = (int)s;		
			issel = true;
		 
		}	//end of dip-line


	}	//end for


	return issel;

}


/*
	分離的X,Y浮點(diǎn)數(shù)組版本
*/
BOOL isVCrossAtLine(float pox, float poy, float psx[], float psy[],
					int nps, float &smin, int &ipos,
						double &x0,  double &y0)
{
	float p1x, p1y;
	float p2x, p2y;

	double A2,B2,C2;
	double s;
	double xk;
	
	double A,B,C;
	
	int issel = 0;

	nps--;
 
	for (int j=0; j<nps; j++)
	{
		p1x = psx[j];
		p1y = psy[j];

		p2x = psx[j+1];
		p2y = psy[j+1];

		A =  p1y - p2y;
		B =  p2x - p1x;
		
		if (A==0 && B==0)
		{
			if (pox == p1x && poy==p1y)
			{
				ipos = j;
				smin = 0;
				return true;
			}
			continue;
		}

		C = -p1x*A - p1y*B;

		//點(diǎn)到直線的距離:
		s = fabs(A*pox + B*poy +C)/sqrt( B*B+ A*A);
 
		if (s>=smin ) continue;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲毛片av在线| 国产美女一区二区| 青青草一区二区三区| 日本特黄久久久高潮| 久久精品国产精品亚洲综合| 日本系列欧美系列| 免费在线观看日韩欧美| 国产自产v一区二区三区c| 大桥未久av一区二区三区中文| 99久久精品免费看国产| 在线免费一区三区| 欧美一区二区性放荡片| 国产性色一区二区| 伊人色综合久久天天| 日韩成人精品在线观看| 国产一区二区三区免费看 | 波多野结衣的一区二区三区| 色狠狠一区二区三区香蕉| 91精品国产全国免费观看| 国产精品私房写真福利视频| 日韩中文字幕91| av网站免费线看精品| 欧美高清视频在线高清观看mv色露露十八 | 日韩欧美国产wwwww| 亚洲天堂福利av| 捆绑调教美女网站视频一区| 日本精品视频一区二区三区| 久久免费看少妇高潮| 亚洲高清一区二区三区| 成人a免费在线看| 337p日本欧洲亚洲大胆色噜噜| 亚洲一区二区三区四区五区黄| 成人免费视频免费观看| 日韩欧美www| 亚洲超碰精品一区二区| 99精品视频在线免费观看| 精品日韩99亚洲| 亚洲成在线观看| 99久久久国产精品| 久久综合久久综合久久综合| 午夜精品一区在线观看| 91免费观看视频在线| 国产亚洲一区二区三区在线观看| 免费看日韩精品| 欧美日韩大陆一区二区| 一区二区三区日本| 色欲综合视频天天天| 国产精品美女久久久久久| 激情文学综合网| 日韩免费看网站| 美女在线一区二区| 欧美日本在线视频| 一个色妞综合视频在线观看| heyzo一本久久综合| 中文字幕av不卡| 国产福利一区二区三区在线视频| 风流少妇一区二区| 国产亚洲人成网站| 国产精品一区二区无线| 久久久一区二区三区| 亚洲天堂免费看| 99视频在线观看一区三区| 国产精品看片你懂得| 国产69精品久久99不卡| 日本一区二区三区dvd视频在线| 国产一区不卡在线| 久久日韩精品一区二区五区| 日本vs亚洲vs韩国一区三区| 欧美一级电影网站| 日本午夜精品视频在线观看 | 蜜臀av一区二区| 884aa四虎影成人精品一区| 天天色天天爱天天射综合| 精品视频在线看| 精品国产伦理网| 国产一区二区毛片| 欧美做爰猛烈大尺度电影无法无天| 亚洲精品大片www| 欧美午夜在线一二页| 亚洲国产精品久久久男人的天堂 | 麻豆一区二区在线| 欧美一区二区三区系列电影| 久久精品国产亚洲高清剧情介绍 | 国产精品一二三区| 精品国产乱子伦一区| 夜夜精品浪潮av一区二区三区| 欧美视频在线一区| 日韩中文字幕亚洲一区二区va在线 | 91国产视频在线观看| 亚洲成人在线网站| 欧美一卡2卡3卡4卡| 激情久久五月天| 国产欧美视频一区二区三区| 成人av电影在线网| 亚洲黄色小说网站| 欧美精品在线一区二区三区| 麻豆精品一区二区三区| 久久久无码精品亚洲日韩按摩| 亚洲一区在线播放| 91精品国产美女浴室洗澡无遮挡| 亚洲欧洲成人精品av97| 日本精品免费观看高清观看| 首页国产欧美日韩丝袜| 欧美精品一区二区三区很污很色的 | 欧美高清激情brazzers| 久久黄色级2电影| 国产精品久久久久久久第一福利| 在线中文字幕不卡| 精品一区二区三区在线视频| 国产精品视频在线看| 欧美日韩精品是欧美日韩精品| 国产一区二区三区精品视频| 亚洲精选免费视频| 欧美成人乱码一区二区三区| 波多野结衣中文字幕一区二区三区 | 精品久久久影院| www.激情成人| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产精品无遮挡| 欧美理论片在线| 成人性生交大片免费看中文| 午夜影视日本亚洲欧洲精品| 2021久久国产精品不只是精品| 色av综合在线| 国产麻豆视频一区| 亚洲成人免费av| 国产精品天美传媒| 91精品国产麻豆国产自产在线| 北岛玲一区二区三区四区| 日本午夜一本久久久综合| 自拍偷拍国产精品| 99精品欧美一区| 裸体在线国模精品偷拍| 日韩美女视频在线| 欧美在线综合视频| 国产福利一区二区| 日本怡春院一区二区| 久久你懂得1024| 99麻豆久久久国产精品免费| 精品在线播放午夜| 中文字幕第一区第二区| 欧美一级日韩一级| 91免费看视频| 精一区二区三区| 亚洲图片欧美一区| 亚洲视频 欧洲视频| 久久精品免视看| 日韩欧美国产电影| 91.麻豆视频| 欧美午夜片在线观看| 精品国产sm最大网站免费看| 日本中文在线一区| 亚洲天堂精品在线观看| 久久久影视传媒| www.性欧美| 国产+成+人+亚洲欧洲自线| 蜜桃一区二区三区四区| 亚洲成人动漫av| 一区二区欧美视频| 中文字幕亚洲欧美在线不卡| 久久无码av三级| 精品国产一区二区亚洲人成毛片| 欧美伦理视频网站| 欧美日韩亚洲综合在线| 色噜噜狠狠色综合欧洲selulu| 成人av先锋影音| 成人免费高清在线| 成熟亚洲日本毛茸茸凸凹| 国产成人免费av在线| 韩国女主播成人在线观看| 欧美96一区二区免费视频| 性感美女极品91精品| 亚洲五码中文字幕| 亚洲综合无码一区二区| 日韩一区国产二区欧美三区| 在线观看91av| 91麻豆精品91久久久久久清纯 | 亚洲成人资源网| 亚洲小说春色综合另类电影| 亚洲视频在线一区二区| 亚洲丝袜自拍清纯另类| 亚洲免费av在线| 一区二区高清免费观看影视大全| 亚洲精品国产成人久久av盗摄| 亚洲欧美日韩久久精品| 亚洲视频免费在线观看| 亚洲色图欧美偷拍| 1000部国产精品成人观看| 亚洲精品中文在线观看| 亚洲在线一区二区三区| 亚洲成人免费在线观看| 日韩av成人高清| 免费成人结看片| 国产在线视视频有精品| 国产成人av福利| 91在线观看下载| 欧美三级在线播放| 欧美一区二区三区成人| 亚洲18色成人| 日韩国产高清在线|