How to Find the Area of a Circle Given Three Points

circlesgeometry

let there be three points in $\mathbb{R}^2$, $(x_1,y_1)$, $(x_2,y_2)$, and $(x_3,y_3)$. I want to find the area of the circle that passes through all three points?

I can find the circle by:
$$
\begin{cases}
(x_1 – x_c)^2 + (y_1 – y_c)^2 – r^2\\
(x_2 – x_c)^2 + (y_2 – y_c)^2 – r^2 \\
(x_3 – x_c)^2 + (y_3 – y_c)^2 – r^2
\end{cases}
$$

isolate $y_c$ and $x_c$ as a function of the isolated $y_c$:

$$\begin{cases}
(x_2 – x_c)^2 – (x_1 – x_c)^2 + (y_2 – y_c)^2 – (y_1 – y_c)^2 = 0\\
(x_3 – x_c)^2 – (x_1 – x_c)^2 + (y_3 – y_c)^2 – (y_1 – y_c)^2 = 0
\end{cases}$$

$$\begin{cases}
x_2^2 – 2x_2x_c + x_c^2 – x_1^2 + 2x_1x_c- x_c^2 + (y_2 – y_c)^2 – (y_1 – y_c)^2 = 0\\
x_3^2 – 2x_3x_c + x_c^2 – x_1^2 + 2x_1x_c- x_c^2 + (y_3 – y_c)^2 – (y_1 – y_c)^2 = 0
\end{cases}$$

$$\begin{cases}
x_c = \frac{(y_1 – y_c)^2 – (y_2 – y_c)^2 – (x_2^2 – x_1^2)}{2(x_1 – x_2)}\\
x_c = \frac{(y_1 – y_c)^2 – (y_3 – y_c)^2 – (x_3^2 – x_1^2)}{2(x_1 – x_3)}
\end{cases}$$

$$ y_c= \frac{(x_3x_1 + y_2^2)(x_1 – x_3) + (x_1x_2 + y_3^2)(x_2 – x_1) + (x_2x_3 + y_1^2)(x_3 – x_2)}{2[(y_1 – y_3)(x_1 – x_2) – (y_1 – y_2)(x_1 – x_3)]} $$

From here, we can calculate $x_c$, $y_c$, and $r^2$. Then, the area of the circle $S$ is given by $S=\pi r^2$.

I am going to implement this in a program and I am mainly aiming for runtime optimization. What would be the fastest way to calculate the area $S$ from the three points?

Best Answer

The circumradius is the length from the center of the circle to the vertex of the triangle. $R = \frac{ a b c }{\sqrt{ ( a + b + c ) ( b + c − a ) ( c + a − b ) ( a + b − c ) }}$, where a,b, and c are lengths of the sides of the triangle (see here). I leave it to you as an exercise to find the area of the circumcircle once you know the circumradius. Note that the expression in the denominator (up to a factor of 4) is Heron's formula for the area of the triangle.