//Accepted    0 KB    60 ms
 //给出正多变形上的三个点,求正多形的最小面积
 //记三个点之间的距离a,b,c;
 //由余弦定理得cosA
 //从而可求出sinA,和正多边形所在外接圆的半径r
 //设三条边所对的圆心角为:theta1,theta2,theta3
 //则正多边形所对的圆心角为gcd(theta1,gcd(theta2,theta3))
 //其中gcd(theta1,theta2)为求两个浮点数的最大公约数
 //至此我们可以根据正多边形所在外接圆的半径r和圆心角求出正多边形的面积
 #include <cstdio>
 #include <cstring>
 #include <iostream>
 #include <queue>
 #include <cmath>
 #include <algorithm>
 using namespace std;
 const double Pi=acos(-1.0);
 /**
   * This is a documentation comment block
   * @authr songt
   */
   struct Point
   {
       double x,y;
   }p[];
 double getDis(Point p1,Point p2)
 {
     return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
 }
 double gcd(double a,double b)
 {
     ) return a;
     ) return b;
     return gcd(b,fmod(a,b));
 }
 void slove()
 {
     ],p[]);
     ],p[]);
     ],p[]);
     *b*c);
     -cosA*cosA);
     *sinA);
     //printf("r=%lf\n",r);
     *asin(a/(*r));
     *asin(b//r);
     //double thetaC=2*asin(c/2/r);
     *Pi-thetaA-thetaB;
     //printf("%lf\n",thetaA+thetaB+thetaC);
     double theta=gcd(thetaA,gcd(thetaB,thetaC));
     //printf("theta=%lf\n",theta);
     //printf("Pi=%lf\n",Pi);
     *Pi/theta*r*r/*sin(theta);
     printf("%.6lf\n",s);
 }
 int main()
 {
     ].x,&p[].y,&p[].x,&p[].y,&p[].x,&p[].y)!=EOF)
     slove();
     ;
 }

最新文章

  1. javascript系列:NaN类型
  2. 【原】Python 用例:打印一个 Header Box
  3. ML—随机森林&#183;1
  4. MapReduce排序输出
  5. 关于Ruby的一些知识
  6. PAT (Top Level) Practise 1008 Airline Routes(Tarjan模版题)
  7. Asp.net Vnext IValueProvider
  8. POJ_2385_Apple_Catching_(动态规划)
  9. Restful随笔
  10. ArcGIS API for JavaScript 4.2学习笔记[20] 使用参数查询要素(油井和地震关系)
  11. JavaUtil_06_DES加解密工具
  12. NIO基础篇(三)
  13. 复盘价值1000万的腾讯云硬盘固件&quot;BUG&quot;
  14. android一个倾斜的TextView,适用于标签效果
  15. 洛谷.T21778.过年(线段树 扫描线)
  16. c#代码混淆
  17. 学习笔记2—MATLAB的copyfile技巧
  18. [Python2]介绍关于Uiautomator的watcher使用场景及使用方法
  19. python 游戏(井字棋)
  20. RabbitMQ None of the specified endpoints were reachable

热门文章

  1. C++调用C中编译过的函数要加extern &quot;C&quot;
  2. 部署git服务器 gitServer 软件
  3. MySQL锁监视器
  4. maven 添加支持编译jdk1.7
  5. 【转】 FPGA设计的四种常用思想与技巧
  6. C/C++中的abort、atexit、exit和_Exit
  7. 利用mycat实现mysql数据库读写分离
  8. #Javascript:this用法整理
  9. 纯css3代码写九宫格效果
  10. R语言描述性统计常用函数