views:

269

answers:

3

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?

A: 

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.

Aniko
A: 

http://mathforum.org/library/drmath/view/55239.html

NickSentowski
I was about to link to this one with the comment that it shows the equations written out/explained.http://mathforum.org/library/drmath/view/55166.html
Brandi