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

StackOverflow https://stackoverflow.com/questions/2623673

  •  26-09-2019
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

mr = enter image description here mt = enter image description here

Center coordinates:

enter image description here

enter image description here

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top