The Circumference of the Circle
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 7032   Accepted: 4361

Description

To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't?

You are given the cartesian coordinates of three non-collinear points in the plane. 
Your job is to calculate the circumference of the unique circle that intersects all three points. 

Input

The input will contain one or more test cases. Each test case consists of one line containing six real numbers x1,y1, x2,y2,x3,y3, representing the coordinates of the three points. The diameter of the circle determined by the three points will never exceed a million. Input is terminated by end of file.

Output

For each test case, print one line containing one real number telling the circumference of the circle determined by the three points. The circumference is to be printed accurately rounded to two decimals. The value of pi is approximately 3.141592653589793.

Sample Input

0.0 -0.5 0.5 0.0 0.0 0.5
0.0 0.0 0.0 1.0 1.0 1.0
5.0 5.0 5.0 7.0 4.0 6.0
0.0 0.0 -1.0 7.0 7.0 7.0
50.0 50.0 50.0 70.0 40.0 60.0
0.0 0.0 10.0 0.0 20.0 1.0
0.0 -500000.0 500000.0 0.0 0.0 500000.0

Sample Output

3.14
4.44
6.28
31.42
62.83
632.24
3141592.65

Source

Ulm Local 1996
 
主要用到海伦公式,正弦定理。没什么难度,当然也可以用行列式。原理就是平面几何里面的垂直的左边乘积等于-1,然后建立等式。

poj2242的更多相关文章

  1. POJ2242 The Circumference of the Circle(几何)

    题目链接. 题目大意: 给定三个点,即一个任意三角形,求外接圆的周长. 分析: 外接圆的半径可以通过公式求得(2*r = a/sinA = b/sinB = c/sinC),然后直接求周长. 注意: ...

  2. 【POJ2242】The Circumference of the Circle(初等几何)

    已知三点坐标,算圆面积. 使用初等几何知识,根据海伦公式s = sqrt(p(p - a)(p - b)(p - c)) 和 外接圆直径 d = a * b * c / (2s) 来直接计算. #in ...

随机推荐

  1. lucene 高亮显示

    原文地址: http://blog.csdn.net/javaman_chen/article/details/8224407 Lucene针对高亮显示功能提供了两种实现方式,分别是Highlight ...

  2. Vue + vue-router

    搞了一天的element-ui,vue-router,把侧栏的导航菜单搞了出来后,试着在菜单上加入链接,研究了下官方提供的文档,发现要使用vue-route. 在项目中安装好vue-route, 对照 ...

  3. HDU 2689 sort it - from lanshui_Yang

    Problem Description You want to processe a sequence of n distinct integers by swapping two adjacent ...

  4. 使用Win32::OLE操作Excel——Excel对象模型

    像VBA操作Excel一样,Win32::OLE模块也是通过对象操作来控制Excel. 如果想自动化操作和控制Excel应用程序,则必须要与Excel对象模型所提供的对象进行交互.理解和熟悉Excel ...

  5. android调试系列--使用ida pro调试原生程序

    1.工具介绍 IDA pro: 反汇编神器,可静态分析和动态调试. 模拟机或者真机:运行要调试的程序. 样本:自己编写NDK demo程序进行调试 2.前期准备 2.1  准备样本程序(假设已经配置好 ...

  6. 短信猫编程的一些资料1(At指令发送短信)

    现在正在做TC35的项目, 下面分享一下这几天在网上找到的资料: 手机 SMS PDU 格式参考手册 1.相关的GSM   AT指令     与SMS有关的GSM   AT指令(from   GSM0 ...

  7. Windows 不能在 本地计算机 启动 SQL Server(MSSQLSERVER)。错误码126

    结合自己的解决方案和网络上搜到的内容,现总结如下: 首先你要知道问题出在了什么地方才能针对性处理. 1.打开事件查看器 计算机右击——管理 右侧会出现错误列表,在其中找到SQL server有关的查看 ...

  8. C#中KeyDown和KeyPress区别

    1.比如说TexBox 输入'a' 按下->触发KeyDown事件,然后去处理 ->将a显示输入到文本框后 ->触发KeyPress事件

  9. GTD:是一种态度

    时间管理发展的四个阶段: 第一代理论着重利用便条与备忘录,在忙碌中调配时间与精力: 第二代理论强调行事历与日程表,反映出时间管理已注意到规划未来的重要: 第三代理论正是目前流行的优先级观念.也就是依据 ...

  10. 我的django之旅(三)数据库和模型

    我的django之旅(三)模型和数据库 标签(空格分隔):模型 数据库 ORM 1.django ORM django内置了一套完整的解决方案,其中就包括他自己的ORM.可惜没有使用SQLAlchem ...