Equation of a Circle from 3 Points
(2 dimensions)

Written by Paul Bourke
January 1990

See also: Sphere from 4 points


This note describes a technique for determining the attributes of a circle (centre and radius) given three points P1, P2, and P3 on a plane.

Calculating Centre

Two lines can be formed through 2 pairs of the three points, the first passes through the first two points P1 and P2. Line b passes through the next two points P2 and P3.
The equation of these two lines is

where m is the slope of the line given by

The centre of the circle is the intersection of the two lines perpendicular to and passing through the midpoints of the lines P1P2 and P2 P3. The perpendicular of a line with slope m has slope -1/m, thus equations of the lines perpendicular to lines a and b and passing through the midpoints of P1P2 and P2P3 are

These two lines intersect at the centre, solving for x gives

Calculate the y value of the centre by substituting the x value into one of the equations of the perpendiculars. Alternatively one can also rearrange the equations of the perpendiculars and solve for y.

Radius

The radius is easy, for example the point P1 lies on the circle and we know the centre....

Notes:

Source Code

C++ code implemented as MFC (MS Foundation Class) supplied by Jae Hun Ryu. Circle.cpp, Circle.h.