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

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

?? tktrig.c

?? linux系統(tǒng)下的音頻通信
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*  * tkTrig.c -- * *	This file contains a collection of trigonometry utility *	routines that are used by Tk and in particular by the *	canvas code.  It also has miscellaneous geometry functions *	used by canvases. * * Copyright (c) 1992-1994 The Regents of the University of California. * Copyright (c) 1994 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tkTrig.c 1.27 97/03/07 11:34:35 */#include <stdio.h>#include "tkInt.h"#include "tkPort.h"#include "tkCanvas.h"#undef MIN#define MIN(a,b) (((a) < (b)) ? (a) : (b))#undef MAX#define MAX(a,b) (((a) > (b)) ? (a) : (b))#ifndef PI#   define PI 3.14159265358979323846#endif /* PI *//* *-------------------------------------------------------------- * * TkLineToPoint -- * *	Compute the distance from a point to a finite line segment. * * Results: *	The return value is the distance from the line segment *	whose end-points are *end1Ptr and *end2Ptr to the point *	given by *pointPtr. * * Side effects: *	None. * *-------------------------------------------------------------- */doubleTkLineToPoint(end1Ptr, end2Ptr, pointPtr)    double end1Ptr[2];		/* Coordinates of first end-point of line. */    double end2Ptr[2];		/* Coordinates of second end-point of line. */    double pointPtr[2];		/* Points to coords for point. */{    double x, y;    /*     * Compute the point on the line that is closest to the     * point.  This must be done separately for vertical edges,     * horizontal edges, and other edges.     */    if (end1Ptr[0] == end2Ptr[0]) {	/*	 * Vertical edge.	 */	x = end1Ptr[0];	if (end1Ptr[1] >= end2Ptr[1]) {	    y = MIN(end1Ptr[1], pointPtr[1]);	    y = MAX(y, end2Ptr[1]);	} else {	    y = MIN(end2Ptr[1], pointPtr[1]);	    y = MAX(y, end1Ptr[1]);	}    } else if (end1Ptr[1] == end2Ptr[1]) {	/*	 * Horizontal edge.	 */	y = end1Ptr[1];	if (end1Ptr[0] >= end2Ptr[0]) {	    x = MIN(end1Ptr[0], pointPtr[0]);	    x = MAX(x, end2Ptr[0]);	} else {	    x = MIN(end2Ptr[0], pointPtr[0]);	    x = MAX(x, end1Ptr[0]);	}    } else {	double m1, b1, m2, b2;	/*	 * The edge is neither horizontal nor vertical.  Convert the	 * edge to a line equation of the form y = m1*x + b1.  Then	 * compute a line perpendicular to this edge but passing	 * through the point, also in the form y = m2*x + b2.	 */	m1 = (end2Ptr[1] - end1Ptr[1])/(end2Ptr[0] - end1Ptr[0]);	b1 = end1Ptr[1] - m1*end1Ptr[0];	m2 = -1.0/m1;	b2 = pointPtr[1] - m2*pointPtr[0];	x = (b2 - b1)/(m1 - m2);	y = m1*x + b1;	if (end1Ptr[0] > end2Ptr[0]) {	    if (x > end1Ptr[0]) {		x = end1Ptr[0];		y = end1Ptr[1];	    } else if (x < end2Ptr[0]) {		x = end2Ptr[0];		y = end2Ptr[1];	    }	} else {	    if (x > end2Ptr[0]) {		x = end2Ptr[0];		y = end2Ptr[1];	    } else if (x < end1Ptr[0]) {		x = end1Ptr[0];		y = end1Ptr[1];	    }	}    }    /*     * Compute the distance to the closest point.     */    return hypot(pointPtr[0] - x, pointPtr[1] - y);}/* *-------------------------------------------------------------- * * TkLineToArea -- * *	Determine whether a line lies entirely inside, entirely *	outside, or overlapping a given rectangular area. * * Results: *	-1 is returned if the line given by end1Ptr and end2Ptr *	is entirely outside the rectangle given by rectPtr.  0 is *	returned if the polygon overlaps the rectangle, and 1 is *	returned if the polygon is entirely inside the rectangle. * * Side effects: *	None. * *-------------------------------------------------------------- */intTkLineToArea(end1Ptr, end2Ptr, rectPtr)    double end1Ptr[2];		/* X and y coordinates for one endpoint				 * of line. */    double end2Ptr[2];		/* X and y coordinates for other endpoint				 * of line. */    double rectPtr[4];		/* Points to coords for rectangle, in the				 * order x1, y1, x2, y2.  X1 must be no				 * larger than x2, and y1 no larger than y2. */{    int inside1, inside2;    /*     * First check the two points individually to see whether they     * are inside the rectangle or not.     */    inside1 = (end1Ptr[0] >= rectPtr[0]) && (end1Ptr[0] <= rectPtr[2])	    && (end1Ptr[1] >= rectPtr[1]) && (end1Ptr[1] <= rectPtr[3]);    inside2 = (end2Ptr[0] >= rectPtr[0]) && (end2Ptr[0] <= rectPtr[2])	    && (end2Ptr[1] >= rectPtr[1]) && (end2Ptr[1] <= rectPtr[3]);    if (inside1 != inside2) {	return 0;    }    if (inside1 & inside2) {	return 1;    }    /*     * Both points are outside the rectangle, but still need to check     * for intersections between the line and the rectangle.  Horizontal     * and vertical lines are particularly easy, so handle them     * separately.     */    if (end1Ptr[0] == end2Ptr[0]) {	/*	 * Vertical line.	 */    	if (((end1Ptr[1] >= rectPtr[1]) ^ (end2Ptr[1] >= rectPtr[1]))		&& (end1Ptr[0] >= rectPtr[0])		&& (end1Ptr[0] <= rectPtr[2])) {	    return 0;	}    } else if (end1Ptr[1] == end2Ptr[1]) {	/*	 * Horizontal line.	 */    	if (((end1Ptr[0] >= rectPtr[0]) ^ (end2Ptr[0] >= rectPtr[0]))		&& (end1Ptr[1] >= rectPtr[1])		&& (end1Ptr[1] <= rectPtr[3])) {	    return 0;	}    } else {	double m, x, y, low, high;    	/*	 * Diagonal line.  Compute slope of line and use	 * for intersection checks against each of the	 * sides of the rectangle: left, right, bottom, top.	 */    	m = (end2Ptr[1] - end1Ptr[1])/(end2Ptr[0] - end1Ptr[0]);	if (end1Ptr[0] < end2Ptr[0]) {	    low = end1Ptr[0];  high = end2Ptr[0];	} else {	    low = end2Ptr[0]; high = end1Ptr[0];	}    	/*	 * Left edge.	 */    	y = end1Ptr[1] + (rectPtr[0] - end1Ptr[0])*m;	if ((rectPtr[0] >= low) && (rectPtr[0] <= high)		&& (y >= rectPtr[1]) && (y <= rectPtr[3])) {	    return 0;	}    	/*	 * Right edge.	 */    	y += (rectPtr[2] - rectPtr[0])*m;	if ((y >= rectPtr[1]) && (y <= rectPtr[3])		&& (rectPtr[2] >= low) && (rectPtr[2] <= high)) {	    return 0;	}    	/*	 * Bottom edge.	 */    	if (end1Ptr[1] < end2Ptr[1]) {	    low = end1Ptr[1];  high = end2Ptr[1];	} else {	    low = end2Ptr[1]; high = end1Ptr[1];	}	x = end1Ptr[0] + (rectPtr[1] - end1Ptr[1])/m;	if ((x >= rectPtr[0]) && (x <= rectPtr[2])		&& (rectPtr[1] >= low) && (rectPtr[1] <= high)) {	    return 0;	}    	/*	 * Top edge.	 */    	x += (rectPtr[3] - rectPtr[1])/m;	if ((x >= rectPtr[0]) && (x <= rectPtr[2])		&& (rectPtr[3] >= low) && (rectPtr[3] <= high)) {	    return 0;	}    }    return -1;}/* *-------------------------------------------------------------- * * TkThickPolyLineToArea -- * *	This procedure is called to determine whether a connected *	series of line segments lies entirely inside, entirely *	outside, or overlapping a given rectangular area. * * Results: *	-1 is returned if the lines are entirely outside the area, *	0 if they overlap, and 1 if they are entirely inside the *	given area. * * Side effects: *	None. * *-------------------------------------------------------------- */	/* ARGSUSED */intTkThickPolyLineToArea(coordPtr, numPoints, width, capStyle, joinStyle, rectPtr)    double *coordPtr;		/* Points to an array of coordinates for				 * the polyline:  x0, y0, x1, y1, ... */    int numPoints;		/* Total number of points at *coordPtr. */    double width;		/* Width of each line segment. */    int capStyle;		/* How are end-points of polyline drawn?				 * CapRound, CapButt, or CapProjecting. */    int joinStyle;		/* How are joints in polyline drawn?				 * JoinMiter, JoinRound, or JoinBevel. */    double *rectPtr;		/* Rectangular area to check against. */{    double radius, poly[10];    int count;    int changedMiterToBevel;	/* Non-zero means that a mitered corner				 * had to be treated as beveled after all				 * because the angle was < 11 degrees. */    int inside;			/* Tentative guess about what to return,				 * based on all points seen so far:  one				 * means everything seen so far was				 * inside the area;  -1 means everything				 * was outside the area.  0 means overlap				 * has been found. */     radius = width/2.0;    inside = -1;    if ((coordPtr[0] >= rectPtr[0]) && (coordPtr[0] <= rectPtr[2])	    && (coordPtr[1] >= rectPtr[1]) && (coordPtr[1] <= rectPtr[3])) {	inside = 1;    }    /*     * Iterate through all of the edges of the line, computing a polygon     * for each edge and testing the area against that polygon.  In     * addition, there are additional tests to deal with rounded joints     * and caps.     */    changedMiterToBevel = 0;    for (count = numPoints; count >= 2; count--, coordPtr += 2) {	/*	 * If rounding is done around the first point of the edge	 * then test a circular region around the point with the	 * area.	 */	if (((capStyle == CapRound) && (count == numPoints))		|| ((joinStyle == JoinRound) && (count != numPoints))) {	    poly[0] = coordPtr[0] - radius;	    poly[1] = coordPtr[1] - radius;	    poly[2] = coordPtr[0] + radius;	    poly[3] = coordPtr[1] + radius;	    if (TkOvalToArea(poly, rectPtr) != inside) {		return 0;	    }	}	/*	 * Compute the polygonal shape corresponding to this edge,	 * consisting of two points for the first point of the edge	 * and two points for the last point of the edge.	 */	if (count == numPoints) {	    TkGetButtPoints(coordPtr+2, coordPtr, width,		    capStyle == CapProjecting, poly, poly+2);	} else if ((joinStyle == JoinMiter) && !changedMiterToBevel) {	    poly[0] = poly[6];	    poly[1] = poly[7];	    poly[2] = poly[4];	    poly[3] = poly[5];	} else {	    TkGetButtPoints(coordPtr+2, coordPtr, width, 0, poly, poly+2);	    /*	     * If the last joint was beveled, then also check a	     * polygon comprising the last two points of the previous	     * polygon and the first two from this polygon;  this checks	     * the wedges that fill the beveled joint.	     */	    if ((joinStyle == JoinBevel) || changedMiterToBevel) {		poly[8] = poly[0];		poly[9] = poly[1];		if (TkPolygonToArea(poly, 5, rectPtr) != inside) {		    return 0;		}		changedMiterToBevel = 0;	    }	}	if (count == 2) {	    TkGetButtPoints(coordPtr, coordPtr+2, width,		    capStyle == CapProjecting, poly+4, poly+6);	} else if (joinStyle == JoinMiter) {	    if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,		    (double) width, poly+4, poly+6) == 0) {		changedMiterToBevel = 1;		TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4,			poly+6);	    }	} else {	    TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6);	}	poly[8] = poly[0];	poly[9] = poly[1];	if (TkPolygonToArea(poly, 5, rectPtr) != inside) {	    return 0;	}    }    /*     * If caps are rounded, check the cap around the final point     * of the line.     */    if (capStyle == CapRound) {	poly[0] = coordPtr[0] - radius;	poly[1] = coordPtr[1] - radius;	poly[2] = coordPtr[0] + radius;	poly[3] = coordPtr[1] + radius;	if (TkOvalToArea(poly, rectPtr) != inside) {	    return 0;	}    }    return inside;}/* *-------------------------------------------------------------- * * TkPolygonToPoint -- * *	Compute the distance from a point to a polygon. * * Results: *	The return value is 0.0 if the point referred to by *	pointPtr is within the polygon referred to by polyPtr *	and numPoints.  Otherwise the return value is the *	distance of the point from the polygon. * * Side effects: *	None. * *-------------------------------------------------------------- */doubleTkPolygonToPoint(polyPtr, numPoints, pointPtr)    double *polyPtr;		/* Points to an array coordinates for				 * closed polygon:  x0, y0, x1, y1, ...				 * The polygon may be self-intersecting. */    int numPoints;		/* Total number of points at *polyPtr. */    double *pointPtr;		/* Points to coords for point. */{    double bestDist;		/* Closest distance between point and				 * any edge in polygon. */    int intersections;		/* Number of edges in the polygon that				 * intersect a ray extending vertically				 * upwards from the point to infinity. */    int count;    register double *pPtr;    /*     * Iterate through all of the edges in the polygon, updating     * bestDist and intersections.     *     * TRICKY POINT:  when computing intersections, include left     * x-coordinate of line within its range, but not y-coordinate.     * Otherwise if the point lies exactly below a vertex we'll     * count it as two intersections.     */    bestDist = 1.0e36;    intersections = 0;    for (count = numPoints, pPtr = polyPtr; count > 1; count--, pPtr += 2) {	double x, y, dist;	/*	 * Compute the point on the current edge closest to the point	 * and update the intersection count.  This must be done	 * separately for vertical edges, horizontal edges, and	 * other edges.	 */	if (pPtr[2] == pPtr[0]) {	    /*	     * Vertical edge.	     */	    x = pPtr[0];	    if (pPtr[1] >= pPtr[3]) {		y = MIN(pPtr[1], pointPtr[1]);		y = MAX(y, pPtr[3]);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产麻豆精品| 欧美日韩三级视频| 国产成人a级片| 国产自产视频一区二区三区| 日韩va亚洲va欧美va久久| 亚洲bt欧美bt精品| 天天综合天天综合色| 性欧美疯狂xxxxbbbb| 亚洲www啪成人一区二区麻豆| 亚洲福利视频一区| 免费观看成人av| 国内外成人在线| 国产精品亚洲一区二区三区妖精 | 欧美精品一区二区久久久| 日韩三级伦理片妻子的秘密按摩| 日韩美一区二区三区| 久久影音资源网| 国产精品短视频| 亚洲一级二级在线| 三级一区在线视频先锋| 国模一区二区三区白浆| 国产成人在线观看免费网站| 风间由美性色一区二区三区| 色综合久久天天| 欧美日韩国产一级片| 欧美tickle裸体挠脚心vk| 国产精品三级视频| 洋洋av久久久久久久一区| 蜜臀av性久久久久蜜臀aⅴ| 国产成人av电影在线观看| 91无套直看片红桃| 91精品在线免费观看| 欧美激情一区三区| 艳妇臀荡乳欲伦亚洲一区| 香蕉加勒比综合久久| 国产一区二区网址| 一本到不卡免费一区二区| 制服丝袜激情欧洲亚洲| 国产日韩精品一区二区三区在线| 亚洲男人的天堂在线aⅴ视频| 亚洲高清视频的网址| 国产激情视频一区二区在线观看| kk眼镜猥琐国模调教系列一区二区 | 青青草精品视频| 国产寡妇亲子伦一区二区| 在线免费不卡电影| 欧美成va人片在线观看| 亚洲欧洲日产国码二区| 日本伊人午夜精品| 91片在线免费观看| 久久青草国产手机看片福利盒子| 一区二区三区四区高清精品免费观看 | 99久久99久久久精品齐齐| 欧美一区二区福利视频| 综合中文字幕亚洲| 久久黄色级2电影| 欧洲精品在线观看| 国产精品视频看| 免费成人在线观看视频| 91伊人久久大香线蕉| 精品国产青草久久久久福利| 亚洲精品中文字幕乱码三区 | 欧美色综合久久| 国产午夜精品福利| 视频在线观看国产精品| 91欧美一区二区| 国产丝袜欧美中文另类| 蜜臀av性久久久久蜜臀av麻豆| 91女厕偷拍女厕偷拍高清| 久久久综合网站| 蜜臀av性久久久久蜜臀aⅴ | 1024成人网| 国产乱一区二区| 欧美一二三区在线| 性感美女极品91精品| 在线观看中文字幕不卡| 中文字幕中文字幕一区二区| 国产在线精品一区二区不卡了| 欧美精品777| 一区二区三区电影在线播| www.一区二区| 久久精品欧美一区二区三区麻豆| 麻豆久久久久久久| 91精品在线观看入口| 亚洲18色成人| 在线亚洲一区二区| 成人欧美一区二区三区白人| 丰满岳乱妇一区二区三区| 久久久久久久一区| 国产在线一区二区综合免费视频| 69久久夜色精品国产69蝌蚪网| 一区二区高清视频在线观看| av激情综合网| 亚洲欧美激情一区二区| 99久久99久久免费精品蜜臀| 国产精品国产三级国产三级人妇 | 国产aⅴ综合色| www国产成人| 国产精品一线二线三线| 久久嫩草精品久久久久| 狠狠色狠狠色综合| 久久久精品蜜桃| 成人毛片老司机大片| 国产精品初高中害羞小美女文| 成人高清视频免费观看| 国产精品高清亚洲| 色婷婷综合中文久久一本| 亚洲另类色综合网站| 欧洲精品在线观看| 日韩精品一区第一页| 日韩欧美一区二区久久婷婷| 精品在线播放午夜| 国产日韩精品一区二区浪潮av| 懂色av中文一区二区三区| 亚洲视频一区二区免费在线观看| 91香蕉国产在线观看软件| 亚洲综合在线第一页| 7777女厕盗摄久久久| 激情六月婷婷久久| 国产欧美精品在线观看| 99国产精品久| 亚洲国产你懂的| 精品少妇一区二区三区在线视频 | 久久亚洲精品国产精品紫薇| 国产成人亚洲综合a∨婷婷图片| 国产精品视频在线看| 欧美在线一二三| 久久精品99国产国产精| 中文字幕第一区二区| 欧美亚洲综合色| 狠狠狠色丁香婷婷综合激情| 中文字幕在线一区免费| 在线亚洲+欧美+日本专区| 裸体一区二区三区| 国产精品色婷婷久久58| 欧美色综合天天久久综合精品| 狂野欧美性猛交blacked| 亚洲国产精品二十页| 欧美调教femdomvk| 激情综合色综合久久| 最新久久zyz资源站| 8x8x8国产精品| 成人的网站免费观看| 亚洲bt欧美bt精品| 中文文精品字幕一区二区| 欧美午夜免费电影| 国产寡妇亲子伦一区二区| 亚洲aaa精品| 中文字幕第一区综合| 91精品国产一区二区| 成人app网站| 日韩激情视频网站| 国产精品久久久久久久久免费丝袜| 欧美日韩免费电影| 成人小视频免费在线观看| 日韩av成人高清| 亚洲图片另类小说| 久久久综合网站| 欧美日韩不卡一区| jlzzjlzz亚洲女人18| 精品中文字幕一区二区小辣椒| 亚洲视频在线一区观看| 久久精品人人做人人综合| 欧美精品在线观看播放| 波多野结衣中文字幕一区二区三区| 亚洲一区二区三区三| 中文字幕第一区| 精品国产一区二区精华| 欧美日韩中文一区| 99精品视频一区| 国产一区视频在线看| 免费在线观看日韩欧美| 亚洲一区二区偷拍精品| 国产精品久久久久一区二区三区 | 国产亚洲欧美日韩俺去了| 欧美视频精品在线观看| 97精品视频在线观看自产线路二| 久久精品久久久精品美女| 婷婷久久综合九色国产成人| 亚洲欧美激情视频在线观看一区二区三区| 精品国产一区二区三区久久久蜜月| 欧美午夜电影网| 91视频.com| 成人av在线一区二区三区| 国产精品一区在线观看乱码| 日韩av电影免费观看高清完整版 | 日韩一级高清毛片| 欧美日韩日日摸| 色婷婷久久99综合精品jk白丝| 成人中文字幕在线| 国产一区在线观看视频| 久草在线在线精品观看| 五月天一区二区三区| 亚洲成人免费在线观看| 亚洲国产一二三| 亚洲午夜一二三区视频| 夜夜爽夜夜爽精品视频| 亚洲六月丁香色婷婷综合久久 | 国产一区免费电影| 国产一区在线不卡|