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

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

?? xlines.cpp

?? Windows上的MUD客戶端程序
?? CPP
字號:
/*----------------------------------------------------------------------------
                        _                              _ _       
        /\             | |                            | (_)      
       /  \   _ __   __| |_ __ ___  _ __ ___   ___  __| |_  __ _ 
      / /\ \ | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` | |/ _` |
     / ____ \| | | | (_| | | | (_) | | | | | |  __/ (_| | | (_| |
    /_/    \_\_| |_|\__,_|_|  \___/|_| |_| |_|\___|\__,_|_|\__,_|

    The contents of this file are subject to the Andromedia Public
	License Version 1.0 (the "License"); you may not use this file
	except in compliance with the License. You may obtain a copy of
	the License at http://www.andromedia.com/APL/

    Software distributed under the License is distributed on an
	"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
	implied. See the License for the specific language governing
	rights and limitations under the License.

    The Original Code is Pueblo client code, released November 4, 1998.

    The Initial Developer of the Original Code is Andromedia Incorporated.
	Portions created by Andromedia are Copyright (C) 1998 Andromedia
	Incorporated.  All Rights Reserved.

	Andromedia Incorporated                         415.365.6700
	818 Mission Street - 2nd Floor                  415.365.6701 fax
	San Francisco, CA 94103

    Contributor(s):
	--------------------------------------------------------------------------
	   Chaco team:  Dan Greening, Glenn Crocker, Jim Doubek,
	                Coyote Lussier, Pritham Shetty.

					Wrote and designed original codebase.

------------------------------------------------------------------------------

----------------------------------------------------------------------------*/

#include <ChTriangle.h>
/* lines_intersect:  AUTHOR: Mukesh Prasad
 *
 *   This function computes whether two line segments,
 *   respectively joining the input points (x1,y1) -- (x2,y2)
 *   and the input points (x3,y3) -- (x4,y4) intersect.
 *   If the lines intersect, the output variables x, y are
 *   set to coordinates of the point of intersection.
 *
 *   All values are in integers.  The returned value is rounded
 *   to the nearest integer point.
 *
 *   If non-integral grid points are relevant, the function
 *   can easily be transformed by substituting floating point
 *   calculations instead of integer calculations.
 *
 *   Entry
 *        x1, y1,  x2, y2   Coordinates of endpoints of one segment.
 *        x3, y3,  x4, y4   Coordinates of endpoints of other segment.
 *
 *   Exit
 *        x, y              Coordinates of intersection point.
 *
 *   The value returned by the function is one of:
 *
 *        DONT_INTERSECT    0
 *        DO_INTERSECT      1
 *        COLLINEAR         2
 *
 * Error conditions:
 *
 *     Depending upon the possible ranges, and particularly on 16-bit
 *     computers, care should be taken to protect from overflow.
 *
 *     In the following code, 'long' values have been used for this
 *     purpose, instead of 'int'.
 *
 */

#define	DONT_INTERSECT    0
#define	DO_INTERSECT      1
#define COLLINEAR         2

/**************************************************************
 *                                                            *
 *    NOTE:  The following macro to determine if two numbers  *
 *    have the same sign, is for 2's complement number        *
 *    representation.  It will need to be modified for other  *
 *    number systems.                                         *
 *                                                            *
 **************************************************************/

#define SAME_SIGNS( a, b )	\
		((a) * (b) >= 0 )

int lines_intersect( float x1, float y1,   /* First line segment */
		     float x2, float y2,

		     float x3, float y3,   /* Second line segment */
		     float x4, float y4,

		     float &x,
		     float &y         /* Output value:
		                * point of intersection */
               )
{
    float a1, a2, b1, b2, c1, c2; /* Coefficients of line eqns. */
    float r1, r2, r3, r4;         /* 'Sign' values */
    float denom, /*offset,*/ num;     /* Intermediate values */

    /* Compute a1, b1, c1, where line joining points 1 and 2
     * is "a1 x  +  b1 y  +  c1  =  0".
     */

    a1 = y2 - y1;
    b1 = x1 - x2;
    c1 = x2 * y1 - x1 * y2;

    /* Compute r3 and r4.
     */


    r3 = a1 * x3 + b1 * y3 + c1;
    r4 = a1 * x4 + b1 * y4 + c1;

    /* Check signs of r3 and r4.  If both point 3 and point 4 lie on
     * same side of line 1, the line segments do not intersect.
     */

    if ( r3 != 0 &&
         r4 != 0 &&
         SAME_SIGNS( r3, r4 ))
        return ( DONT_INTERSECT );

    /* Compute a2, b2, c2 */

    a2 = y4 - y3;
    b2 = x3 - x4;
    c2 = x4 * y3 - x3 * y4;

    /* Compute r1 and r2 */

    r1 = a2 * x1 + b2 * y1 + c2;
    r2 = a2 * x2 + b2 * y2 + c2;

    /* Check signs of r1 and r2.  If both point 1 and point 2 lie
     * on same side of second line segment, the line segments do
     * not intersect.
     */

    if ( r1 != 0 &&
         r2 != 0 &&
         SAME_SIGNS( r1, r2 ))
        return ( DONT_INTERSECT );

    /* Line segments intersect: compute intersection point. 
     */

    denom = a1 * b2 - a2 * b1;
    if ( denom == 0 )
        return ( COLLINEAR );
   // offset = denom < 0 ? - denom / 2 : denom / 2;

    /* The denom/2 is to get rounding instead of truncating.  It
     * is added or subtracted to the numerator, depending upon the
     * sign of the numerator.
     */

    num = b1 * c2 - b2 * c1;
    //*x = ( num < 0 ? num - offset : num + offset ) / denom;
    x = ( num ) / denom;

    num = a2 * c1 - a1 * c2;
    //*y = ( num < 0 ? num - offset : num + offset ) / denom;
    y = ( num ) / denom;

    return ( DO_INTERSECT );
    } /* lines_intersect */

/* A main program to test the function.
 */
#if defined(TEST_STANDALONE)
main()
{
    float x1, x2, x3, x4, y1, y2, y3, y4;
    float x, y;

    for (;;) {
        printf( "X1, Y1: " );
	scanf( "%ld %ld", &x1, &y1 );
        printf( "X2, Y2: " );
	scanf( "%ld %ld", &x2, &y2 );
        printf( "X3, Y3: " );
	scanf( "%ld %ld", &x3, &y3 );
        printf( "X4, Y4: " );
	scanf( "%ld %ld", &x4, &y4 );

        switch ( lines_intersect( x1, y1, x2, y2, x3, y3, x4, y4, x, y )) {
            case DONT_INTERSECT:
			 printf( "Lines don't intersect\n" );
			 break;
            case COLLINEAR:
                         printf( "Lines are collinear\n" );
                         break;
            case DO_INTERSECT:
			 printf( "Lines intersect at %ld,%ld\n", x, y );
                         break;
            }
        }
    } /* main */
#endif // defined(TEST_STANDALONE)



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本怡春院一区二区| 色婷婷久久久亚洲一区二区三区 | 国产成人av电影在线播放| 久久久美女艺术照精彩视频福利播放| 国产一区二区三区四区五区美女| 国产丝袜美腿一区二区三区| 91成人国产精品| 九一九一国产精品| 一区二区免费看| 日韩欧美美女一区二区三区| 成人黄色av电影| 美腿丝袜一区二区三区| 亚洲黄色在线视频| 久久久亚洲国产美女国产盗摄| www久久精品| 在线观看精品一区| 国产精品一二三区在线| 日产欧产美韩系列久久99| 日本不卡高清视频| 亚洲午夜免费电影| 国产欧美一区二区精品性色超碰| 欧美精品少妇一区二区三区| 成人中文字幕电影| 毛片av一区二区| 国产一区二区不卡| 成人午夜视频网站| 在线精品亚洲一区二区不卡| 欧美日韩成人激情| 在线观看日产精品| 日韩一级二级三级| 91精品婷婷国产综合久久竹菊| 91精品1区2区| 777欧美精品| 久久九九久久九九| 日韩美女视频一区二区| 国产亚洲欧美色| 欧美国产1区2区| 久久久久亚洲综合| 亚洲人成网站影音先锋播放| 亚洲欧美在线另类| 日本一区二区三级电影在线观看| 亚洲免费在线视频一区 二区| 亚洲一二三级电影| 国产精品69毛片高清亚洲| 色噜噜狠狠色综合中国| 91精品国产综合久久香蕉麻豆| 爽好久久久欧美精品| 中文字幕一区二区三| 亚洲不卡在线观看| 亚洲第一福利一区| 国产精品正在播放| 欧美色区777第一页| 欧美色倩网站大全免费| 久久人人超碰精品| 亚洲自拍欧美精品| 性感美女久久精品| 国产成人综合在线播放| 不卡电影一区二区三区| 日韩一二三四区| 自拍偷自拍亚洲精品播放| 免费人成黄页网站在线一区二区| 99久久久无码国产精品| 在线观看欧美黄色| 国产日韩欧美不卡在线| 日本一不卡视频| 色综合欧美在线| 久久嫩草精品久久久精品| 五月婷婷色综合| 美女www一区二区| 色一情一伦一子一伦一区| 久久久久久免费网| 日本在线播放一区二区三区| 日本久久电影网| 中文字幕高清一区| 狠狠色综合日日| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 3d动漫精品啪啪| 亚洲色图欧美在线| 国产精品一区二区视频| 日韩精品一区二区三区视频播放 | 欧美日本一区二区三区四区| 国产精品乱人伦一区二区| 亚洲综合在线观看视频| 国产91在线观看丝袜| 精品久久久久久最新网址| 中文久久乱码一区二区| 久草在线在线精品观看| 欧美一区二区三区系列电影| 欧美经典三级视频一区二区三区| 久久不见久久见中文字幕免费| 99精品一区二区三区| 国产情人综合久久777777| 精品一区二区久久久| 91精品国产黑色紧身裤美女| 亚洲r级在线视频| 欧洲日韩一区二区三区| 亚洲一区二区三区小说| 91国偷自产一区二区三区观看| 国产精品动漫网站| 免费观看成人av| 91 com成人网| 日韩精彩视频在线观看| 欧美精品欧美精品系列| 石原莉奈一区二区三区在线观看| 欧美日韩五月天| 午夜激情久久久| 9191成人精品久久| 免费看日韩a级影片| 精品人在线二区三区| 久久99国内精品| 久久日韩粉嫩一区二区三区| 国产成人av影院| 国产精品免费观看视频| 99re8在线精品视频免费播放| 日韩美女视频19| 欧美在线999| 午夜精品一区二区三区免费视频| 欧美久久久久久久久| 日韩**一区毛片| 久久综合色综合88| 国产91在线观看丝袜| 亚洲欧美日韩系列| 欧美日韩国产精选| 美女mm1313爽爽久久久蜜臀| 国产三区在线成人av| 91在线一区二区| 午夜免费欧美电影| 日韩精品在线看片z| 成人午夜在线播放| 亚洲一二三四在线| 日韩一区二区三区高清免费看看| 狠狠色丁香久久婷婷综合_中| 久久久国产午夜精品| 99久久精品免费观看| 亚洲成人精品一区二区| 精品国产第一区二区三区观看体验 | 久久奇米777| 99视频热这里只有精品免费| 午夜日韩在线观看| 久久久三级国产网站| 在线观看视频一区二区| 青青草国产精品亚洲专区无| 国产拍揄自揄精品视频麻豆| 日本高清不卡aⅴ免费网站| 日本欧美在线观看| 中文字幕av免费专区久久| 91国偷自产一区二区开放时间| 另类综合日韩欧美亚洲| 欧美激情综合五月色丁香| 欧美日韩的一区二区| 懂色av噜噜一区二区三区av| 亚洲狠狠爱一区二区三区| 久久久影视传媒| 欧美日精品一区视频| 国产剧情在线观看一区二区| 亚洲小说春色综合另类电影| 国产亚洲制服色| 欧美视频一区二区在线观看| 午夜精品久久一牛影视| 国产精品视频一二三| 666欧美在线视频| 99久久精品国产网站| 久久国产生活片100| 亚洲一区二区三区中文字幕在线| 久久色成人在线| 欧美高清精品3d| 99热这里都是精品| 国产在线精品一区二区夜色 | 亚洲国产精品久久艾草纯爱| 中文字幕欧美国产| 日韩精品一区国产麻豆| 欧美亚洲国产一区二区三区| 成人国产在线观看| 国产在线精品一区二区不卡了| 亚洲风情在线资源站| 中文字幕一区二区三| 久久综合九色综合欧美98| 91精品国产综合久久久蜜臀图片| 色噜噜狠狠成人网p站| 国产成人午夜精品影院观看视频| 麻豆成人免费电影| 午夜精品一区二区三区电影天堂| 亚洲视频一二三区| 国产精品美女久久久久久| 久久综合狠狠综合| 欧美v日韩v国产v| 欧美日韩一区三区四区| 91丨porny丨中文| 美女网站色91| 天天色综合成人网| 亚洲chinese男男1069| 亚洲免费观看高清完整版在线观看 | 一区二区视频免费在线观看| 国产精品入口麻豆原神| 国产偷国产偷亚洲高清人白洁 | 久久精品999| 麻豆91在线播放免费| 免费在线观看一区二区三区| 亚洲成人精品在线观看| 亚洲成人黄色小说|