Equation of a Circle from 3 Points
(2 dimensions)
Written by Paul Bourke
January 1990
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
Equation of a Circle from 3 Points (2 dimensions)
file:///F|/Geometry/Display 09 Algorithms/Equation of a Circle from 3 Points (2 dimensions).htm (1 of 2) [12/22/2000 03:52:33 PM]
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:
The denominator (mb - ma) is only zero when the lines are parallel in which case they must be
coincident and thus no circle results.
●
If either line is vertical then the corresponding slope is infinite. This can be solved by simply
rearranging the order of the points so that vertical lines do not occur.
●
Source Code
C++ code implemented as MFC (MicroSoft Foundation Class) supplied by Jae Hun Ryu. Circle.cpp,
Circle.h.
Equation of a Circle from 3 Points (2 dimensions)
file:///F|/Geometry/Display 09 Algorithms/Equation of a Circle from 3 Points (2 dimensions).htm (2 of 2) [12/22/2000 03:52:33 PM]