zoj 1090 The Circumference of the Circle
来源:互联网 发布:动态模拟软件 编辑:程序博客网 时间:2024/05/20 18:54
模版题,求三点定圆,求三角行的外心
数学都记不得了,,
#include <bits/stdc++.h>using namespace std;#define PI 3.141592653589793struct point{ double x,y; point() {} point(double a,double b):x(a),y(b) {}};point CircumCenter(point a,point b,point c){ point cp; double a1=b.x-a.x,b1=b.y-a.y,c1=(a1*a1+b1*b1)/2; double a2=c.x-a.x,b2=c.y-a.y,c2=(a2*a2+b2*b2)/2; double d=a1*b2-a2*b1; cp.x=a.x+(c1*b2-c2*b1)/d; cp.y=a.y+(a1*c2-a2*c1)/d; return cp;}int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); point a,b,c; while(scanf("%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y)!=EOF){ point cp=CircumCenter(a,b,c); double r=sqrt(pow(cp.x-a.x,2.0)+pow(cp.y-a.y,2.0)); printf("%.2f\n",2*r*PI); } return 0;}
0 0
- zoj 1090 The Circumference of the Circle
- zoj 1090 The Circumference of the Circle
- ZOJ 1090-The Circumference of the Circle
- zoj 1090 || poj 2242 The Circumference of the Circle
- php - zoj 1090 The Circumference of the Circle
- TOJ 1132 ZOJ 1090 The Circumference of the Circle
- POJ 2242|ZOJ 1090 The Circumference of the Circle
- The Circumference of the Circle
- pku2242The Circumference of the Circle
- zoj 1090 The Circumference of the Circle(海伦公式+正弦定理)
- ZOJ 1090 The Circumference of the Circle(计算三角形的外接圆)
- zoj1090 The Circumference of the Circle
- ZOJ1090 The Circumference of the Circle
- POJ 2242 The Circumference of the Circle
- poj 2242 The Circumference of the Circle
- HOJ 1439 The Circumference of the Circle
- UVa 438 - The Circumference of the Circle
- hdu 1374 The Circumference of the Circle
- Technical Settings for the Workload Monitor
- release版本程序调用libvlc接口出现异常
- String to Integer (atoi)
- 算法导论第12章 红黑树
- 程序错误及故障分析(指针问题导致)
- zoj 1090 The Circumference of the Circle
- 反编译工具jad的使用
- nginx缓存过期管理小结
- POJ1273(最大流入门)
- Android实现左右滑动滑屏的功能
- 好站分享-互联网行业优秀网站分享、干货超多
- LeetCode Palindrome Partitioning I&&Palindrome Partitioning II
- 【生活随笔】Introspection of my life in 2014
- 进程的用户ID探究