青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品


Intersecting Lines

Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 4260 Accepted: 2049

Description

We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in a line because they are on top of one another (i.e. they are the same line), 3) intersect in a point. In this problem you will use your algebraic knowledge to create a program that determines how and where two lines intersect.
Your program will repeatedly read in four points that define two lines in the x-y plane and determine how and where the lines intersect. All numbers required by this problem will be reasonable, say between -1000 and 1000.

Input

The first line contains an integer N between 1 and 10 describing how many pairs of lines are represented. The next N lines will each contain eight integers. These integers represent the coordinates of four points on the plane in the order x1y1x2y2x3y3x4y4. Thus each of these input lines represents two lines on the plane: the line through (x1,y1) and (x2,y2) and the line through (x3,y3) and (x4,y4). The point (x1,y1) is always distinct from (x2,y2). Likewise with (x3,y3) and (x4,y4).

Output

There should be N+2 lines of output. The first line of output should read INTERSECTING LINES OUTPUT. There will then be one line of output for each pair of planar lines represented by a line of input, describing how the lines intersect: none, line, or point. If the intersection is a point then your program should output the x and y coordinates of the point, correct to two decimal places. The final line of output should read "END OF OUTPUT".

Sample Input

5
0 0 4 4 0 4 4 0
5 0 7 6 1 0 2 3
5 0 7 6 3 -6 4 -3
2 0 2 27 1 5 18 5
0 3 4 0 1 2 2 5

Sample Output

INTERSECTING LINES OUTPUT
POINT 2.00 2.00
NONE
LINE
POINT 2.00 5.00
POINT 1.07 2.20
END OF OUTPUT
/*************************************
計算幾何基礎題,判斷直線相交及求交點
注意斜率不存在的情況
*************************************
*/

#include 
<iostream>
#include 
<cstdio>

int main()
{
    
double x1, y1, x2, y2, x3, y3, x4, y4;
    
int n;
    
double k1, k2;
    
double b1, b2;
    
double i_x, i_y;
    scanf(
"%d"&n);
    std::cout 
<< "INTERSECTING LINES OUTPUT" << std::endl;
    
while( n-- )
    
{
        scanf(
"%lf%lf%lf%lf%lf%lf%lf%lf"&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);

        
if( x1 != x2 && x3 != x4 )
        
{
            k1 
= ( y2 - y1 ) / ( x2 - x1 );
            k2 
= ( y4 - y3 ) / ( x4 - x3 );
            b1 
= y1 - k1 * x1;
            b2 
= y3 - k2 * x3;
            
if( k1 == k2 )
            
{
                
if( b1 == b2 )
                    printf(
"LINE\n");
                
else
                    printf(
"NONE\n");
            }

            
else
            
{
                i_x 
= (b2 - b1) / (k1 - k2);
                i_y 
= k1 * i_x + b1;
                printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
            }

        }

        
else if( x1 == x2 && x3 == x4 )
        
{
            
if( x1 == x3 )
            std::cout 
<< "LINE\n";
            
else
            std::cout 
<< "NONE\n";
        }

        
else if( x1 == x2 && x3 != x4 )
        
{
            k2 
= ( y4 - y3 ) / ( x4 - x3 );
            b2 
= y3 - k2 * x3;
            i_x 
= x1;
            i_y 
= k2 * x1 + b2;
            printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
        }

        
else
        
{
            k1 
= ( y2 - y1 ) / ( x2 - x1 );
            b1 
= y1 - k1 * x1;
            i_x 
= x3;
            i_y 
= k1 * x3 + b1;
            printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
        }

    }

    std::cout 
<< "END OF OUTPUT\n";
    
return 0;
}

posted on 2010-10-03 11:03 Vontroy 閱讀(822) 評論(0)  編輯 收藏 引用 所屬分類: 計算幾何POJ
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲日本一区二区| 亚洲精品国产精品乱码不99按摩| 久久免费精品视频| 最新国产精品拍自在线播放| 久热精品视频在线观看一区| 国内精品久久久久久久果冻传媒| 亚洲欧美卡通另类91av| 亚洲另类自拍| 欧美午夜久久久| 亚洲天堂av在线免费观看| 最新国产成人在线观看| 伊人久久大香线蕉av超碰演员| 久久精品在线播放| 久久成人免费电影| 亚洲国产你懂的| 欧美电影资源| 另类天堂视频在线观看| 久久久亚洲国产美女国产盗摄| 久久精品网址| aaa亚洲精品一二三区| 日韩一二三区视频| 国产精品网站在线观看| 久久精品人人做人人综合| 免费看亚洲片| 艳妇臀荡乳欲伦亚洲一区| 久久婷婷丁香| 欧美电影在线观看| 亚洲国产成人av好男人在线观看| 亚洲激情网站| 一区二区国产日产| 欧美一区二区三区久久精品茉莉花 | 欧美福利在线| 91久久精品日日躁夜夜躁欧美 | 久久亚洲一区二区| 久久久久久久999| 国产综合久久| 久久久无码精品亚洲日韩按摩| 亚洲视频视频在线| 欧美性大战久久久久| 亚洲一卡久久| 亚洲高清一二三区| 欧美大尺度在线观看| 久久动漫亚洲| 欧美日韩视频在线一区二区| 久久成人亚洲| 在线观看日韩一区| 欧美激情一区二区三区蜜桃视频 | 亚洲欧美一区二区三区在线 | 免费成人网www| 久久精品亚洲精品| 亚洲高清资源| 欧美先锋影音| 欧美在线地址| 久久久精品一区| 亚洲国产精品一区二区第四页av | 欧美黄色一区| 欧美成人精品在线播放| 国产欧美午夜| 亚洲午夜伦理| 另类天堂视频在线观看| 国产欧美一区二区色老头| 久久野战av| 亚洲图片欧美午夜| 你懂的亚洲视频| 亚洲欧美日韩国产一区二区| 亚洲第一精品夜夜躁人人爽| 欧美在线免费视屏| 亚洲欧洲日本国产| 久久久噜久噜久久综合| 99这里有精品| 伊人男人综合视频网| 欧美视频在线观看免费网址| 日韩一区二区久久| 久久亚洲精品中文字幕冲田杏梨| 国产女主播一区二区| 免费短视频成人日韩| 午夜精品福利在线| 午夜在线a亚洲v天堂网2018| 国产精品高清一区二区三区| 亚洲视频免费在线观看| 亚洲欧美在线免费观看| 亚洲日产国产精品| 欧美精品一区二区三区蜜桃| 亚洲精品乱码久久久久久蜜桃麻豆| 久久av资源网站| 亚洲视频一区| 91久久精品日日躁夜夜躁欧美 | 先锋影音国产一区| 99re6这里只有精品视频在线观看| 欧美激情成人在线| 久久九九99| 午夜日韩视频| 欧美成人蜜桃| 久久婷婷久久一区二区三区| 欧美一区二区三区在线免费观看 | 西西人体一区二区| 亚洲视频中文| 一区二区三区www| 亚洲美女啪啪| 国产精品久久久久高潮| 欧美精品一区二区三区很污很色的 | 欧美福利小视频| 男女激情久久| 免费成人网www| 女生裸体视频一区二区三区| 久久久蜜桃精品| 久久久国产精品一区| 久久精品观看| 久久久美女艺术照精彩视频福利播放| 欧美在线看片a免费观看| 欧美一区午夜精品| 欧美在线视频在线播放完整版免费观看| 一本一道久久综合狠狠老精东影业 | 亚洲国产精品久久久久久女王| 红桃视频成人| 欧美婷婷在线| 国产精品久久久爽爽爽麻豆色哟哟| 久久精品视频免费| 久久久久久久尹人综合网亚洲| 久久精品亚洲一区二区| 久久激情综合| 欧美91福利在线观看| 欧美精品日韩| 欧美色精品在线视频| 国产精品一二三视频| 欧美日韩mv| 久久伊人亚洲| 欧美不卡在线视频| 国产精品av久久久久久麻豆网| 国产精品久久久久久久久免费樱桃 | 亚洲国产精品久久久久秋霞蜜臀 | 欧美亚洲专区| 久久婷婷麻豆| 91久久国产综合久久| 亚洲性视频网址| 欧美一级理论性理论a| 噜噜噜久久亚洲精品国产品小说| 欧美成人中文字幕| 国产精品久久久久久av下载红粉 | 亚洲美女少妇无套啪啪呻吟| 夜夜嗨av一区二区三区网页| 午夜久久99| 欧美激情成人在线视频| 久久精品综合| 亚洲激情电影中文字幕| 一区二区三区成人精品| 久久精品夜色噜噜亚洲aⅴ| 欧美日产一区二区三区在线观看 | 亚洲毛片在线观看.| 欧美一区二区三区喷汁尤物| 欧美国产日韩xxxxx| 国产日韩欧美在线| 国产精品女人毛片| 亚洲黄色高清| 欧美自拍偷拍午夜视频| 亚洲国产欧美一区| 先锋a资源在线看亚洲| 欧美啪啪成人vr| 韩国欧美一区| 欧美一级网站| 亚洲狼人精品一区二区三区| 久久精品国产99精品国产亚洲性色 | 久久久久久久999| 国产精品视频免费观看| 亚洲啪啪91| 久久久噜噜噜久久| 亚洲一区自拍| 欧美亚洲日本一区| 欧美体内she精视频在线观看| 亚洲第一区在线观看| 欧美制服丝袜第一页| 99国产精品久久久久久久久久| 99在线|亚洲一区二区| 美女免费视频一区| 国内精品免费午夜毛片| 性伦欧美刺激片在线观看| 99pao成人国产永久免费视频| 欧美成人一二三| 亚洲国产精品成人| 裸体丰满少妇做受久久99精品| 亚洲一区二区三区四区中文| 欧美日韩亚洲一区在线观看| 亚洲日本成人女熟在线观看| 免费在线亚洲欧美| 久久在线免费观看视频| 狠狠色狠狠色综合日日tαg| 久久福利影视| 欧美一区网站| 国产婷婷色一区二区三区在线| 西西裸体人体做爰大胆久久久| 夜夜嗨av色一区二区不卡| 欧美日韩国产精品一区| 一区二区不卡在线视频 午夜欧美不卡' | 久久大逼视频| 香蕉视频成人在线观看| 国产欧美日韩一区| 久久久久久久久久码影片| 欧美一区二区三区日韩视频| 国模套图日韩精品一区二区| 久久人人97超碰精品888|