Friday, January 16, 2009

three points defining the center of a circle

Because it's a Friday and because this stumpted me (stupidly, wasn't dividing by the det) last night, here is a diagram explaining this algorithm for finding the center of a circle from 3 points:

2

One of the best tricks I've found is to always work with lines in the matrix form ax + by = c as it avoids the problems with vertical lines that y=mx+c has. Storing the end points of the line is the other fail-safe as it contains bounds information, but isn't as convenient when working with gradients and takes a whole extra constant!

The above was a Friday attempt at block-colouring matrix operations. I'm not sure it was a success, but it makes it more obvious that we where hunting the determinant as the denominator.

[edit] you shouldn't substitue for the y-coord as I give in the above, it might lead to divide-by-zero's. Best thing is to find the equivalent equation with the determinant as the denominator, as the linked algorithm page explains.,

1 comment:

  1. here's another idea: http://home.att.net/~srschmitt/circle3pts.html

    ReplyDelete