How to determine the radius and center of a circle when only three noncollinear points are known?

妖精的绣舞 提交于 2019-12-22 10:39:43

问题


I'm working on a C# program that deals with Oracle Spatial geometry. When circle data is stored in a geometry field only three non-collinear points are stored to represent the circle. The problem is that I need to use this data on a Google Maps web page and need the center point and radius of the circle (since my circle drawing function uses that information).

Can anyone help with the math involved and translating said math to C#? I think this page may hold the answer, but I'm having a hard time following it. There are formulas for radius and center given three points, but then they define the variables as matrices and I get lost at that point. How would I solve that in code?


回答1:


mr = mt =

Center coordinates:

Courtesy of http://www.regentsprep.org/regents/math/geometry/gcg6/RCir.htm

Edit: Old link was dead.




回答2:


You are right that formulas (28)-(34) have the answer to your question. The key to note is that (31)-(34) are not just matrices, but determinants of matrices. Wikipedia gives the formula for calculating the determinant of a 3x3 matrix which is all that is needed here.



来源:https://stackoverflow.com/questions/2623673/how-to-determine-the-radius-and-center-of-a-circle-when-only-three-noncollinear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!