Me and my collegues stumbled upon a simple geometric question were non of us could provide a quick and descent answer. After some more puzzeling we still could not figure it out.
We all have the feeling it should not be that hard but fail at answering it. We hoped someone here could help us out!
Given 3 random points in a 2 dimensional space.
No point is the same position and the 3 points cannot be on the same line.
Question 1. Can a circle always be drawn which goes through these 3 points?
we assumed yes
Question 2. Is there a simple formula which gives you the radius of this circle?
The formula for circle at center $(a,b)$ with radius $r$ is: $(x -a)^2 + (y-b)^2 = r^2$.
Os if you have three points $(x_1,y_2), (x_2,y_2)$ and $(x_3,y_3)$ then they all belong to a circle and you know:
1: $(x_1 - a)^2 + (y_1-b)^2 = r^2$ and
2: $(x_2 - a)^2 + (y_2-b)^2 = r^2$ and
3: $(x_3 - a)^2 + (y_3-b)^2 = r^2$
Use those three equations and solve for $a,b,r$ using $x_i, y_i$ as constants.
I trust that you will be able to figure that out.
=====
Although it probably easier to find the equation of the line going through $A = (x_1,y_1)$ and $B = (x_2, y_2)$. [It is $y = m_1 x + b_1$. To find $m_1, b_1$ plug in $(x_1, y_1)$ and $(x_2, y_2)$ and see what you get.].
Take the midpoint $(x_m, y_m)$ of $A$ and $B$ and the find the equation of the perpendicular through the midpoint of $A,B$. [It is $y = -\frac 1{m_1} + b_m$. Plug in $x_m, y_m$ to solve for $b_m$].
Do that for the points $B$ and $C = (x_3, y_3)$ to get lint $y= m_2 + b_2$ and and the midpoint $(x_{m_2}, y_{m_2})$ so the perpendicular line $y= -\frac 1{m_2} + b_{m_2}$].
Find the intersection of the perpendicular lines at $(a,b)$ [by solving plugging $(a,b)$ into both $y = -\frac 1{m_1} + b_m$ and $y= -\frac 1{m_2} + b_{m_2}$]
That use geometry reasoning to conclude those lines intersect at the center of the circle.
The radius will $r = d(A,(a,b)) = d(B, (a,b)) = d(C, (a,b))$ wher $d((x_1, y_1), (a,b)) = \sqrt {(x_1 -a)^2 + (y_2-b)^2}$