We all know that a circle is exactly defined by three distinct non-collinear points. But I need a way to solve the following problem (all in 2D):

Given three points, calculate a circle with all three points on its border if it exists, else calculate a circle with minimum radius which has two points on its border, and containing the third. The latter should happen when the three points are collinear.

I tried to draw all cases that can exist, but I do not come up with something elegant as a solution. Has somebody an easy way for it?

  • $\begingroup$ "when at least two of the are collinear"? Two points are always collinear, three points are always coplanar. The exceptional case is when all three points are collinear (which includes as special case that some points may coincide) $\endgroup$ – Hagen von Eitzen Dec 2 '13 at 21:44
  • $\begingroup$ I'm afraid the use of the word collinear in "two points of them are collinear to each other (two of them have same x- logic or y-coordinates)" is utter gibberish. $\endgroup$ – Will Jagy Dec 2 '13 at 21:44
  • $\begingroup$ It is, and I apologize. Hope it is now better. $\endgroup$ – reindeer Dec 2 '13 at 21:47

Hint: If the three points are colinear, they are in order on a line. If one of them has to be inside the circle, which one is it? Do you know the construction to find the circle if they are not colinear?

  • $\begingroup$ If the line is parallel to x-axis, its the one with the median x value, if its parallel to y-axis, its the one with the median y-value. Yes, I totally had a brain lag when asking this question. I already have the version with three non-collinear points, but get an error state when they are. $\endgroup$ – reindeer Dec 2 '13 at 21:55
  • 1
    $\begingroup$ Better said: if it is not parallel to the $x$ axis, it is the one with median $y$ value. You can always use one median or the other to find the central point. $\endgroup$ – Ross Millikan Dec 2 '13 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.