poj 2986 A Triangle and a Circle

mtttt 2010-04-12 10:20:45
A Triangle and a Circle
Time Limit: 5000MS Memory Limit: 131072K
Total Submissions: 1194 Accepted: 214 Special Judge

Description

Given one triangle and one circle in the plane. Your task is to calculate the common area of these two figures.

Input

The input will contain several test cases. Each line of input describes a test case. Each test case consists of nine floating point numbers, x1, y1, x2, y2, x3, y3, x4, y4 and r, where (x1, y1), (x2, y2) and (x3, y3) are the three vertices of the triangle and (x4, y4) is the center of the circle and r is the radius. We guarantee the triangle and the circle are not degenerate.

Output

For each test case you should output one real number, which is the common area of the triangle and the circle, on a separate line. The result should be rounded to two decimal places.

Sample Input

0 20 10 0 -10 0 0 0 10
Sample Output

144.35
Source

POJ Monthly--2006.08.27, Rainer

哪位大侠提供点思路呗,不甚感激
...全文
223 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

69,368

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧