Circle Through Three Points

From CGAFaq

Jump to: navigation, search

Let the three given points be a, b, c. Use ax and ay to represent the x and y coordinates of a, and so on. The coordinates of the center p=(px,py) of the circle determined by a, b, and c are:

A = bx - ax
B = by - ay
C = cx - ax
D = cy - ay
E = A*(ax + bx) + B*(ay + by)
F = C*(ax + cx) + D*(ay + cy)
G = 2*(A*(cy - by)-B*(cx - bx))
px = (D*E - B*F) / G
py = (A*F - C*E) / G

If G is zero then the three points are collinear and no finite-radius circle through them exists. Otherwise, the radius of the circle is:

r² = (ax - px)² + (ay - py

Reference:

  • [O’Rourke (C)] p. 201. Simplified by Jim Ward.
Personal tools