zoukankan      html  css  js  c++  java
  • 三角形的外心

    三角形外接圆圆心

    Where is the little Jgshining?

    #include<bits/stdc++.h>
    using namespace std;
    double xx1,yy1,xx2,yy2,xx3,yy3;
    int main( )
    {
       int t;
       scanf("%d",&t);
       while(t--)
       {
           scanf("%lf%lf%lf%lf%lf%lf",&xx1,&yy1,&xx2,&yy2,&xx3,&yy3);
           if(xx3==xx1&&yy3==yy1)
           {
               printf("%.1lf %.1lf
    ",xx1+xx2/2,yy1+yy2/2);
           }
           else if(yy2==yy3&&xx2==xx3)
           {
               printf("%.1lf %.1lf
    ",xx1+xx2/2,yy1+yy2/2);
           }
           else if(yy2==yy1&&xx2==xx1)
           {
               printf("%.1lf %.1lf
    ",xx1+xx3/2,yy1+yy3/2);
           }
           else if(((xx3-xx2)*(yy2-yy1)-(xx2-xx1)*(yy3-yy2))==0)
           {
               printf("No this position
    ");
           }
           else
           {
               double a=((yy2-yy1)*(yy3*yy3-yy1*yy1+xx3*xx3-xx1*xx1)-(yy3->yy1)*(yy2*yy2-yy1*yy1+xx2*xx2-xx1*xx1))/(2.0*((xx3-xx1)*(yy2-yy1)-(xx2->xx1)*(yy3-yy1)));
               double b=((xx2-xx1)*(xx3*xx3-xx1*xx1+yy3*yy3-yy1*yy1)-(xx3->xx1)*(xx2*xx2-xx1*xx1+yy2*yy2-yy1*yy1))/(2.0*((yy3-yy1)*(xx2-xx1)-(yy2->yy1)*(xx3-xx1)));
               double r=sqrt((xx1-a)*(xx1-a)+(yy1-b)*(yy1-b));
               printf("%.1lf %.1lf
    ",a,b);
           }
       }
       return 0;
    }
    
  • 相关阅读:
    html5 to jsp
    java通过springMail发送邮件
    solr配置-Solrconfig.xml
    solr配置-Schema.xml
    solr连接数据库导入数据
    log4j 1.2 配置总结
    1-12 ARP协议
    1-11 ICMP协议
    1-10 网际层
    1-9 TCP/IP参考模型
  • 原文地址:https://www.cnblogs.com/lcbwwy/p/13138446.html
Copyright © 2011-2022 走看看