从它的3个点计算圆心和半径 [英] Calculate Center and Radius of Circle from 3 points on it

查看:182
本文介绍了从它的3个点计算圆心和半径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可能会显示能够快速执行此操作的代码吗?假设我们按左 - >右的顺序得到三点
p1,p2,p3。因此,解决方案还应该检查圆圈是否有效,即(p1,p2,p3)是逆时针方向。 解决方案

要计算圆圈参数,请看:

http://paulbourke.net/geometry/circlesphere/
寻找3点的方程(2维)

确定方向后,可以使用多边形区域公式:

http://paulbourke.net/geometry/polygonmesh/
寻找计算多边形的面积和质心



请告诉我你是否需要使用特定的编程语言。


Could somebody please show code which would do this quickly? Assume we get three points p1, p2, p3 in left-->right order. Thus, the solution should also check whether or not the circle is valid, ie (p1, p2, p3) are counter-clockwise.

解决方案

To calculate the circle parameters, have a look at:

http://paulbourke.net/geometry/circlesphere/ Look for "Equation of a Circle from 3 Points (2 dimensions)"

to determine orientation, you can use the polygon area formula:

http://paulbourke.net/geometry/polygonmesh/ Look for "Calculating the area and centroid of a polygon"

Please tell me if you need this in an specific programming language.

这篇关于从它的3个点计算圆心和半径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆