开发者

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

开发者 https://www.devze.com 2022-12-26 07:15 出处:网络
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

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 an开发者_如何学Cswer, 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?


mr =

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

mt =

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

Center coordinates:

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

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

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

Edit: Old link was dead.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消