Finding the Center of a Circle Given 3 Points Let (H, K) be the coordinates of the center of the circle, and R its radius. Then the equation of the circle is: (X - H)2 + (Y - K)2 = R2 Since the three points all lie on the circle, their coordinates will satisfy this equation. That gives you three equations: (X1 - H)2 + (Y1 - K)2 = R2 (X2 - H)2 + (Y2 - K)2 = R2 (X3 - H)2 + (Y3 - K)2 = R2 in the three unknowns H, K, and R. To solve these, subtract the first from the other two. That will eliminate R, H2, and K2 from the last two equations, leaving you with two simultaneous linear equations in the two unknowns H and K. R = sqrt[(X1 - H)2+(Y1 - K)2] This can all be done symbolically, of course, but you'll get some pretty complicated expressions for h and k. The simplest forms of these involve determinants, if you know what they are: |(X12 +Y12) Y1 1| |(X22 +Y22) Y2 1| |(X32 +Y32) Y3 1| H = -------------------------------- |X1 +Y1 1| 2 |X2 +Y2 1| |X3 +Y3 1| |X1 (X12 +Y12) 1| |X2 (X22 +Y22) 1| |X3 (X32 +Y32) 1| K = -------------------------------- |X1 +Y1 1| 2 |X2 +Y2 1| |X3 +Y3 1| (X12+Y12)Y2 +(X32+Y32)Y1 +(X22+Y22)Y3 -(X32+Y32)Y2 -(X12+Y12)Y3 -(X22+Y22)Y1 H = -------------------------------------------------------------------------------------------- 2 ( X1 Y2 +X3 Y1 + X2 Y3 - X3 Y2 - X1 Y3 + X2 Y1 ) (X32+Y32)X2 +(X12+Y12)X3 +(X22+Y22)X1- (X12+Y12)X2 -(X32+Y32)X1 -(X22+Y22)X3 K = -------------------------------------------------------------------------------------------- 2 ( X1 Y2 +X3 Y1 + X2 Y3 - X3 Y2 - X1 Y3 + X2 Y1 ) (X12+Y12)(Y2 -Y3)+(X32+Y32)(Y1 -Y2) +(X22+Y22)(Y3 -Y1) H = ----------------------------------------------------------------- 2 ( X1 Y2 +X3 Y1 + X2 Y3 - X3 Y2 - X1 Y3 + X2 Y1 ) (X32+Y32)(X2 -X1) +(X12+Y12)(X3 -X2)+(X22+Y22)(X1 -X3 ) K = ----------------------------------------------------------------- 2 ( X1 Y2 +X3 Y1 + X2 Y3 - X3 Y2 - X1 Y3 + X2 Y1 ) R = sqrt[(X1 - H)2 +(Y1 - K)2] The Sarrus rule for 3 x 3 determinants. |a b c| |d e f| = aei + bfg + cdh - ceg - afh - bdi |g h i|
|(X12
+Y12)
Y1
1|
|(X22
+Y22)
Y2
|(X32
+Y32)
Y3
|X1
+Y1
2
|X2
+Y2
|X3
+Y3
(X12
(X22
(X32
R = sqrt[(X1 - H)2 +(Y1 - K)2]
The Sarrus rule for 3 x 3 determinants.
|a b c| |d e f| = aei + bfg + cdh - ceg - afh - bdi |g h i|