poj 2242 数学(给三点求外接圆周长)
来源:互联网 发布:世界网络多少年了 编辑:程序博客网 时间:2024/06/06 15:03
题意:给定不共线的三点坐标,求其外接圆的周长。
思路:通过坐标可以求出三点围成三角形的面积S。根据正弦定理有a/sinA = 2*R,根据面积公式有S = (bcsinA)/2。消去sinA可得关于R的等式,进而可求周长。
#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <cstdlib>using namespace std;#define clc(s,t) memset(s,t,sizeof(s))#define PI 3.141592653589793double dis(double a,double b,double c,double d){ return sqrt((c-a)*(c-a)+(d-b)*(d-b));}int main(){ double a,b,c,d,e,f; while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){ double s = fabs(a*d+b*e+c*f-d*e-a*f-b*c); printf("%.2f\n",PI*dis(a,b,c,d)*dis(a,b,e,f)*dis(c,d,e,f)/s); } return 0;}
0 0
- poj 2242 数学(给三点求外接圆周长)
- (DS1.5.6)POJ 2242 The Circumference of the Circle(一直三个点的坐标,求外接圆的周长)
- zoj 1090 三角形外接圆周长
- poj 1329(求三角形外接圆)
- UVA 438 求三角形外接圆的周长
- POJ 1329 三角形外接圆
- POJ 2242另一种方式求周长
- poj 1113 Wall(凸包周长)
- POJ 1392(凸包的周长)
- POJ 1113 Wall(凸包周长)
- POJ 1113 Wall(求凸包周长)
- POJ 1113 Wall (凸包求周长)
- POJ 1329 求三角形外接圆
- POJ2242_The Circumference of the Circle(几何/三角形外接圆周长/模板)
- hdu 6242 Geometry Problem(随机化+三点求外接圆)
- POJ-2242 The Circumference of the Circle-已知三点共圆求周长
- POJ数学(ZZ)
- poj 1840 (数学)
- 央行再次降息降准,利好股市,估计2800点附近反弹一两天,人民币贬值预期加强
- vector 避免内存频繁分配释放与手动释放vector内存
- 【C++】复数类的实现
- Slow Feature Analysis(SFA)模型
- leetcode: (118) Pascal's Triangle
- poj 2242 数学(给三点求外接圆周长)
- 删除Android system目录下文件的方法
- hdoj 2824 The Euler function
- GCD大白话
- Strurts2下导出Excel文件(含下载弹出框)
- POJ_2528 Mayor's poster(线段树+离散化)
- 使用.NET中的XML注释(一) -- XML注释标签讲解
- 没有绝对公正——而是竞争
- [leetcode-222]Count Complete Tree Nodes(c)