POJ 2242 The Circumference of the Circle (计算几何)

多模态融合相关概念 多模态图像融合 阅读详情
The Circumference of the Circle

Time Limit:  1000MS
Memory Limit: 65536K

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


由
    S=(a*b*sinC)/2
和
    c/sinC=外接圆直径d
得
    d=(a*b*c)/(2*S)
S由有向面积(行列式)得出

注意:POJ上的C++不支持C99,但G++支持

完整代码:
/*0ms,588KB*/

#include<cstdio>
#include<cmath>
const double PI = acos(-1.0);

inline double area(double x0, double y0, double x1, double y1, double x2, double y2)
{
	return fabs(x0 * y1 + x2 * y0 + x1 * y2 - x2 * y1 - x0 * y2 - x1 * y0);
}

int main(void)
{
	double x0, y0, x1, y1, x2, y2;
	while (~scanf("%lf%lf%lf%lf%lf%lf", &x0, &y0, &x1, &y1, &x2, &y2))
		printf("%.2f\n", hypot(x0 - x1, y0 - y1) * hypot(x1 - x2, y1 - y2) * hypot(x0 - x2, y0 - y2) * PI / area(x0, y0, x1, y1, x2, y2));
	return 0;
}

基于Lstm+transformer的刀具磨损预测实战 阅读详情

相关推荐

CS224W图神经网络实战:如何用Motifs和Graphlets分析社交网络结构?

本文基于斯坦福CS224W课程,深入探讨了如何利用网络模体(Motifs)和图元(Graphlets)分析社交网络的微观结构。通过实战代码演示,文章介绍了如何识别具有统计显著性的关键连接模式,计算节点的图元度向量以刻画局部拓扑特征,并将这些结构洞见应用于社区发现、影响力分析及图神经网络的节点特征工程,从而提升模型在虚假账号检测等任务中的性能。

2w3e4r5t6y的博客 911

POJ - 2242 The Circumference of the Circle【三点定圆】

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 th...

slass-mot-odet 522

STM32 ST-LINK Utility 无法烧录程序的解决方法

当你打开STM32 ST-LINK Utility,硬件连接好st-link V2,打开了要烧写的文件,点那个Program verify烧录时, 如果出错了: Programming error @ 0x08000000! 我的方法是: 点你想要烧录那个HEX文件的小格,复制 然后去到你前面的文件的格子里,点粘贴: 成功! ...

wocute的博客 9521

The Circumference of the Circle C语言 ZOJ1090

使用的是高中数学的一个公式,p=(a+b+c)/2,s=sqrt(p*(p-a)*(p-b)*(p-c)),由正弦定理a/sinA=b/sinB=c/sinC=2r,s=0.5*a*b*sinC,所以r=a*b*c/(4*s),然后就可以求周长了。 1 #include <stdio.h> 2 #include <ma...

weixin_30507269的博客 170

数字信号的艺术演绎:用FPGA+DAC实现音乐合成器的核心原理

本文深入探讨了如何利用FPGA和DAC技术实现数字音乐合成器的核心原理,涵盖DDS架构、多波形合成、MIDI协议解析及动态包络控制等关键技术。通过详细的Verilog代码示例和硬件实现方案,展示了数字信号处理在音乐合成中的艺术演绎,为电子音乐创作提供了强大的硬件支持。

weixin_28256233的博客 390

SUMO仿真教程(5) —— 使用“XML“语言自定义构建路网

文章目录一.简要介绍1.node file2.edge file3.lane definitions(1)路段细分(2)邻近的对向车道(3)删除边或车道4.type file(1)简要概述(2)edge定义中引用type文件的示例(3)指定车辆种类的速度限制5.connections file(1)简要概述:(2)connection的属性参数(3)删除连接(4)设置连接的优先级(5)同一边的多个连接二.演示示例:1.自定义编写node file2.自定义编写edge file3.自定义编写type fil

weixin_50632459的博客 5017

POJ 2242.The Circumference of the Circle

题目为给定三角形三个点,计算外接圆的周长,这个要用到一点三角函数的知识,都忘记的差不多了也是从网上搜其他人的思路才搜出来... a/sinA = 2R 其中R是外接圆半径 在各种公式中使用到的PI可以通过PI = acos(-1)得到最为准确的值(cos(PI) = -1等价arccos(-1) = PI) 这是第一道涉及计算几何类使用的题目,是最基础的计算几何,练习目的就是为了熟悉一下这些...

CuriousLiu的博客 433

HR离职预测模型实战:可解释、可干预、可落地的三层架构

员工离职预测本质上是组织健康度的早期诊断技术,其核心原理在于从行为、心理与结构数据中识别稳定性衰减信号。该技术的价值不仅在于提升预测准确率,更在于将模糊的‘人才风险’转化为可归因、可干预的具体因子,如工龄阶段、满意度落差、薪酬分位数等。典型应用场景覆盖HRBP主动留任、业务部门梯队预警及HRIS系统智能升级。本文聚焦于构建具备业务可解释性与操作闭环能力的离职预警模型,深度融合HR工作流与机器学习工程实践,尤其强调逻辑回归基线、特征业务化重构及三层递进式架构设计。

赵士杰的博客 387

poj2242

解题思路: 根据坐标计算出三边长,再根据海伦公式计算面积,再根据s=abc/4r 计算出外接圆半径,然后算出周长 #include #include #include using namespace std; int main(){ const double PI=3.141592653589793; double x1,y1,x2,y2,x3,y3,a,b,c,p,s,r,le

天未欲使从是也,吾辈必济。 644

别再让C盘爆红了!手把手教你将Anaconda虚拟环境迁移到其他盘(附权限问题解决)

本文详细指导如何将Anaconda虚拟环境从C盘迁移到其他驱动器,解决C盘空间不足问题。通过conda config命令和直接修改.condarc配置文件两种方法,确保环境迁移顺利进行,同时提供权限问题解决方案和长期维护技巧,帮助用户高效管理虚拟环境。

weixin_42525289的博客 421

【HAL库】STM32CubeMX开发----STM32F407----ETH+LWIP----TCPclient客户端

STM32F407开发板 为TCPclient客户端,PC端 为TCPserver服务端,相互之间的发送和接收实验。

MQ0522的博客 3049

POJ 2242 The Circumference of the Circle 简单数学

The Circumference of the Circle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7848   Accepted: 4766 Description To calculate the circumference of a circle se

MY Blog 842

【AI智能体】QClaw 对接GitHub处理自动化任务实战操作详解

QClaw 对接GitHub处理自动化任务实战操作详解

congge 4869

POJ 2242 - The Circumference of the Circle

//感觉略奇葩,答案输出应该没问题的,但是持续WA中

Latte_z的小站 645

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

POJ2242 ZOJ1090 The Circumference of the Circle

//1_5_6: The Circumference of the Circle 三点确定圆 POJ2242 ZOJ1090 #include #include #include #include using namespace std; const double pi = 3.141592653589793; int main() { double x1,y1,x2,y2,x3,y3,

206

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

POJ 2242 The Circumference of the Circle

<br />完全是数学知识,求面积时可以利用三角形有向面积公式<br /> <br />#include <iostream> #include <cmath> #include <iomanip> using namespace std; const double PI = 3.141592653589793; double nX1, nX2, nX3, nY1, nY2, nY3; double square(double x) { return x*x; } int main()

Unimen的专栏 837

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

POJ2242-The Circumference of the Circle

http://poj.org/problem?id=2242 知道外接圆半径公式就好了,r=a*b*c/(4*s),水题。 #include<stdio.h> #include<math.h> const double pi=3.141592653589793; int main(void) { double C,r,x1,y1,x2,y2,x3...

weixin_30872789的博客 124

zoj 1090 || poj 2242 The Circumference of the Circle

<br />这也算计算几何???><。。。我一直把这类题归类于关于数的处理。。。<br /> <br />给你三个点,求这三个点的外接圆的周长。<br /> <br />套公式即可。<br /> <br />看来需要把遇到的数学公式总结下了。<br /> <br />#include <queue> #include <stack> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #incl

小媛在努力~ 1151

POJ 2242|ZOJ 1090 The Circumference of the Circle

The Circumference of the Circle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7915   Accepted: 4808 Description To calculate the circumference of a circle

在风雨中奔跑 540

hdu4195Regular Convex Polygon poj2242The Circumference of the Circle

#include #include #include #include using namespace std; const double eps=1e-6;//这个错了可能wa const double pi=acos(-1.0); inline bool dcmp(double x){ if(x<eps)return 0; return x>0?1:-1; } stru

coder_coder_coder的专栏 567

W - The Circumference of the Circle(POJ 2242)

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-colline...

weixin_44011353的博客 175

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

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

banxuanliu0005的博客 177

poj 2242 The Circumference of the Circle

/* Name:2242 The Circumference of the Circle Author:Unimen Date: 18/04/11 18:24*//*解题报告:1、r = abc/4s2、求面积有两种解法:海伦公式,三角形有向面积3、C++里输出小数的用法4、小数为负数的判断要注意不要与0比较,见注释*///海伦公式解法 #

Unimen的专栏 889

POJ2242_The Circumference of the Circle(几何/三角形外接圆周长/模板)

The Circumference of the Circle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7017   Accepted: 4353 Description To calculate the circumference of a circle

_nplus 984

POJ 2242 The Circumference of the Circle

题目描述 三点确定一个圆,利用海伦凯勒公式求出三点围成的三角形的面积,再利用正弦定理求出圆的半径 s=abc/4r #include<iostream> #include<cmath> #include<cstdio> const double PI=3.141592653589793; using namespace std; int main(){ double x1,y1,x2,y2,x3,y3,a,b,c,p,s,r,len; while(cin

qaqaqa666的博客 217
上一篇: UVa 10010 Where's Waldorf? (八方向字符串匹配&模板题)
下一篇: POJ 1833 排列 (STL)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值