# How to generate a circle through three points

Let the three given points be a, b, c. Use x and y subscripts represent x
and y coordinates, so that the x and y co-ordinates of a are a_{x}
and a_{y}.

The coordinates of the center p = (p_{x}, p_{y}) of the circle determined by a, b, and c are:

A = b_{x}- a_{x}B = b_{y}- a_{y}C = c_{x}- a_{x}D = c_{y}- a_{y}E = A × (a_{x}+ b_{x}) + B × (a_{y}+ b_{y}) F = C × (a_{x}+ c_{x}) + D × (a_{y}+ c_{y}) G = 2 × (A × (c_{y}- b_{y}) - B × (c_{x}- b_{x})) p_{x}= (D × E - B × F) ÷ G p_{y}= (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^{2}= (a_{x}- p_{x})^{2}+ (a_{y}- p_{y})^{2}

Original resource: | The Delphi Pool |
---|---|

Author: | Joseph O'Rourke |

Added: | 2009-11-06 |

Last updated: | 2009-11-06 |