Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Circle Calculations

J. Riggs
12-Apr-2017

Problem Statement
Given: The (x, y) coordinates of three points
Find: Center coordinates and radius of a circle that
passes through the three points

Method
The three points are defined as Points A, B, and C with
coordinates (Ax, Ay), (Bx, By), and (Cx, Cy).

1. Test for non-solution


If the three points are collinear, there is no solution. Test for this condition by calculating mAB , the slope
̅̅̅̅, and mBC , the slope of line segment 𝐵𝐶
of line segment 𝐴𝐵 ̅̅̅̅ .

1.1. Test for infinite slope


𝐵𝑦−𝐴𝑦
If Ax = Bx, then mAB is infinite, otherwise 𝑚𝐴𝐵 = 𝐵𝑥−𝐴𝑥
𝐶𝑦−𝐵𝑦
If Bx = Cx then mBC is infinite, otherwise 𝑚𝐵𝐶 =
𝐶𝑥−𝐵𝑥

1.2. Test for linearity


If mAB = mBC then the three points are collinear and there is no solution.

2. Select Two Points


Two of the points are selected. The equation is calculated for a line which passes through the midpoint
of the line segment defined by the two points, with slope perpendicular to the line segment. However,
the perpendicular line must not have an infinite slope. By default, we select Points A and B. However, if
mAB is zero, we cannot use these two points, since the perpendicular will have an infinite slope. In this
case, substitute point C for Point B:
By default, Point P1 = A: (P1x = Ax, P1y = Ay)
2.1. Case 1 mAB ≠ 0
Point P2 = B: (P2x = Bx, P2y = By)
2.2. Case 2 mAB = 0
Point P2 = C: (P2x = Cx, P2y = Cy)
3. Calculate the Perpendicular line Parameters
The perpendicular line is defined by its slope (m)
and y-intercept, b. We will need one point which
is known to lie on the line – this is the mid-point
between points P1 and P2.
3.1. Compute the slope of the line

If case = 1 then 𝑚 = −1⁄𝑚𝐴𝐵

Otherwise case = 2 and


𝐶𝑦−𝐴𝑦
𝑚 = −1⁄𝑚𝐴𝐶 , where 𝑚𝐴𝐶 = 𝐶𝑥−𝐴𝑥

3.2. Compute the coordinates of the mid point


𝑃1𝑥 +𝑃2𝑥 𝑃1𝑦 +𝑃2𝑦
mid𝑥 = 2
mid𝑦 = 2

3.3. Compute the Y-intercept of the line


𝑏 = mid𝑦 − 𝑚 ⋅ mid𝑥

4. Calculate the Circle Center Point


The line represent the loci of all points which are equidistant to Points P1 and P2.
The center of the circle is a point that lies on the perpendicular line and is equidistant to all three points,
therefore, we must find the coordinates of the point
in the line which is equidistant from point P3, and one
of the first two points (Either P1 or P2 will do). We
will arbitrarily select P1.

̅̅̅̅̅
The square of the Distance 𝑃 1 𝐷 is given by;
2
̅̅̅̅̅
|𝑃 2 2
1 𝐷 | = (𝑃1𝑥 − 𝐷𝑥 ) + (𝑃1𝑦 − 𝐷𝑦 )
̅̅̅̅̅
Similarly, the square of the distance 𝑃 3 𝐷 is ;
2
̅̅̅̅̅
|𝑃 2 2
3 𝐷 | = (𝑃3𝑥 − 𝐷𝑥 ) + (𝑃3𝑦 − 𝐷𝑦 )

Substitute Dy = m Dx + b
̅̅̅̅̅
Set |𝑃 2 ̅̅̅̅̅ 2
1 𝐷 | = |𝑃3 𝐷 | , and solve for x.

This results in the following solution for the coordinated of point D:

𝑃32𝑥 +𝑃32𝑦 − 𝑃12𝑥 − 𝑃12𝑦 + 2𝑏(𝑃1𝑦 − 𝑃3𝑦 )


𝐷𝑥 =
2[𝑃3𝑥 − 𝑃1𝑥 + 𝑚(𝑃3𝑦 − 𝑃1𝑦 )]

𝐷𝑦 = 𝑚𝐷𝑥 + 𝑏

The circle radius is computed as the distance from point D to any of the other three points.

You might also like