19

Given 3 points A, B and C

enter image description here

How can I find and arc that begins at A, ends at C and pass through B; its center's coordinates, radius and angles for r and r' ?

enter image description here

duffymo
  • 305,152
  • 44
  • 369
  • 561
ibrabeicker
  • 1,786
  • 2
  • 19
  • 31
  • How will you solve the problem when all 3 points make an equilateral triangle? I'm not sure the problem is specified well enough. – Mark Ransom Apr 01 '14 at 16:47
  • 3
    @Mark then you have an arc that is 2/3 of a complete circle – ibrabeicker Apr 01 '14 at 16:48
  • 1
    The circle is well-defined as long as the points aren't on one line. But which points you consider "start" and "end" of the arc is arbitrary. Oh, and of course `r == r'`. – Thomas Apr 01 '14 at 16:49
  • Sorry, I didn't read clearly enough, didn't notice that A and C were specified to be the endpoints. – Mark Ransom Apr 01 '14 at 16:57

6 Answers6

8

There are a few ways to do this. Here is one algorithm:

  1. Get your COORDS

    A = {xA,yA}

    B = {xB,yB}

    C = {xC,yC}

    d = {xd,yd}

  2. Calculate Mid-points of lines AB and BC

    mid_AB = { (xA+xB)/2, (yA+yB)/2 }

    mid_BC = { (xB+xC)/2, (yB+yC)/2 }

  3. Find slopes of lines AB and BC

    slope_AB = (yB-yA)/(xB-xA)

    slope_BC = (yC-yB)/(xC-xB)

  4. Construct lines running through mid-points PERPENDICULAR to AB and BC (thank you to Yves for catching the negative!)

    Slope_perp_AB = -(slope_AB)^(-1)

    Slope_perp_BC = -(slope_BC)^(-1)

    *** Line with Slope_perp_AB runs through mid_AB

    *** Line with Slope_perp_BC runs through mid_BC

  5. Set the two equations equal to each other and solve to find intersection! This gives you point d={xd,yd} !!!

Calculating the radius and angles is now trivial with the center-point d!

Community
  • 1
  • 1
Joshua
  • 328
  • 1
  • 7
  • 1
    Caution, the slope of the perpendicular is -1/m, not +1/m. You should prefer the implicit formulation of the line equations, as they are more isotropic and valid for horizontals/verticals. –  Apr 01 '14 at 19:49
  • Can you please write a proof?IOW define xA,yA,xB,yB,xC,yC,xd,yd show 'all steps to get the xd,yd COORDS?Im not sure what you mean by the 'Slope_perp' are you dividing by -1? or to the power of -1?? and i dont understand the math behind 'Set the two equations equal to each other' aswhell – DarkPh03n1X Jan 13 '16 at 09:13
  • You need to have a check that slopes are defined. Denominators could be zero. – Victor Engel Nov 17 '18 at 16:35
  • 2
    Demonstration of the [Equation of a circle from 3 points](http://paulbourke.net/geometry/circlesphere/) – Rémi Jan 04 '19 at 08:56
8

The center of the circle is equidistant to the three given points:

(X-Xa)^2+(Y-Ya)^2 = (X-Xb)^2+(Y-Yb)^2 = (X-Xc)^2+(Y-Yc)^2

Subtracting the first member from the second and the third, we get after regrouping:

2(Xa-Xb) X + 2(Ya-Yb) Y + Xb^2+Yb^2-Xa^2-Ya^2 = 0
2(Xa-Xc) X + 2(Ya-Yc) Y + Xc^2+Yc^2-Xa^2-Ya^2 = 0

This linear system of two equations in two unknowns is easy to solve with Cramer's rule.

The radius and angles can be found using the Cartesian-to-polar transform around the center:

R= Sqrt((Xa-X)^2+(Ya-Y)^2)

Ta= atan2(Ya-Y, Xa-X)
Tc= atan2(Yc-Y, Xc-X)

But you still miss one thing: what is the relevant part of the arc ? Smaller or larger than a half turn ? From Ta to Tb or from Tb to 2 Pi to Ta + 2 Pi, or what ? The answer is much less obvious than it seems, try it (because the three angles Ta, Tb and Tc are undeterminate to a multiple of 2 Pi and you cannot sort them) !

Hint: consider the sign of the area of the triangle ABC, precisely the half of the determinant of the system. It will tell you if B lies on the left or the right of AC.

  • You wrote two answers. This one is more popular but it ends with a question. Your rep on maths SE hints you know the answer to that question. Did you leave your answer like that because you wrote it on April Fools Day? – pateksan Jun 30 '20 at 21:41
  • @pateksan: the hint should be sufficient. –  Jun 30 '20 at 23:15
  • 3
    I get that. My beef is that stack exchange is supposed to be a "question and answer" network, not a "question, half-answer and hint" network. Maybe I'm just in a bad mood though. – pateksan Jul 01 '20 at 00:05
  • @pateksan: I gave two different answers using two methods, I included the formulas for the angles as asked by the OP (though he accepts another answer that does not) plus I raised an issue nobody else addressed and gave the solution (though as a hint because it depends on the exact conventions the OP will use). So yes, I think you are in a bad mood. –  Jul 01 '20 at 00:47
4

Step 1

Find the perpendicular bisector of AB and BC.

Step 2

Find the point in which these lines are intersected.

The point you will find would be the center of the circle you want.

Step 3

Calculate the distance of one of the three points from the center you found on Step 2. That would be the radius of you circle.

NOTE The points A, B and C must not be in the same line. You have to check this, before you execute the Steps 1 to 3.

Christos
  • 53,228
  • 8
  • 76
  • 108
2

The solution to this is almost identical to the "circle of best fit for a non-over-determined system". Since you have three points which are exactly on the arc former by the circle centered at (0,0) (given), the system can be solved exactly rather than requiring a least-squares approximation.

Finding the Center of a Circle Given 3 Points


Date: 05/25/2000 at 00:14:35
From: Alison Jaworski
Subject: finding the coordinates of the center of a circle

Hi,

Can you help me? If I have the x and y coordinates of 3 points - i.e. 
(x1,y1), (x2,y2) and (x3,y3) - how do I find the coordinates of the 
center of a circle on whose circumference the points lie?

Thank you.


Date: 05/25/2000 at 10:45:58
From: Doctor Rob
Subject: Re: finding the coordinates of the center of a circle

Thanks for writing to Ask Dr. Math, Alison.

Let (h,k) be the coordinates of the center of the circle, and r its 
radius. Then the equation of the circle is:

     (x-h)^2 + (y-k)^2 = r^2

Since the three points all lie on the circle, their coordinates will 
satisfy this equation. That gives you three equations:

     (x1-h)^2 + (y1-k)^2 = r^2
     (x2-h)^2 + (y2-k)^2 = r^2
     (x3-h)^2 + (y3-k)^2 = r^2

in the three unknowns h, k, and r. To solve these, subtract the first 
from the other two. That will eliminate r, h^2, and k^2 from the last 
two equations, leaving you with two simultaneous linear equations in 
the two unknowns h and k. Solve these, and you'll have the coordinates 
(h,k) of the center of the circle. Finally, set:

     r = sqrt[(x1-h)^2+(y1-k)^2]

and you'll have everything you need to know about the circle.

This can all be done symbolically, of course, but you'll get some 
pretty complicated expressions for h and k. The simplest forms of 
these involve determinants, if you know what they are:

         |x1^2+y1^2  y1  1|        |x1  x1^2+y1^2  1|
         |x2^2+y2^2  y2  1|        |x2  x2^2+y2^2  1|
         |x3^2+y3^2  y3  1|        |x3  x3^2+y3^2  1|
     h = ------------------,   k = ------------------
             |x1  y1  1|               |x1  y1  1|
           2*|x2  y2  1|             2*|x2  y2  1|
             |x3  y3  1|               |x3  y3  1|

Example: Suppose a circle passes through the points (4,1), (-3,7), and 
(5,-2). Then we know that:

     (h-4)^2 + (k-1)^2 = r^2
     (h+3)^2 + (k-7)^2 = r^2
     (h-5)^2 + (k+2)^2 = r^2

Subtracting the first from the other two, you get:

     (h+3)^2 - (h-4)^2 + (k-7)^2 - (k-1)^2 = 0
     (h-5)^2 - (h-4)^2 + (k+2)^2 - (k-1)^2 = 0

     h^2+6*h+9 - h^2+8*h-16 + k^2-14*k+49 - k^2+2*k-1 = 0
     h^2-10*h+25 - h^2+8*h-16 + k^2+4*k+4 - k^2+2*k-1 = 0

     14*h - 12*k + 41 = 0
     -2*h + 6*k + 12 = 0

     10*h + 65 = 0
     30*k + 125 = 0

     h = -13/2
     k = -25/6

Then

     r = sqrt[(4+13/2)^2 + (1+25/6)^2]
       = sqrt[4930]/6

Thus the equation of the circle is:

     (x+13/2)^2 + (y+25/6)^2 = 4930/36

- Doctor Rob, The Math Forum
  http://mathforum.org/dr.math/   

References


  1. Finding the Center of a Circle Given Three Points, Accessed 2014-04-01, <http://mathforum.org/library/drmath/view/55239.html>
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Cloud
  • 18,753
  • 15
  • 79
  • 153
1

You have three equations to determine the three unknowns xM, yM and R,

(xA-xM)^2+(yA-yM^2) = R^2

etc. Subtracting the A equation from the B and C equations gives

2*(xB-xA)*xM+2*(yB-yA)*yM = xB^2-xA^2+yB^2-yA^2
2*(xC-xA)*xM+2*(yC-yA)*yM = xC^2-xA^2+yC^2-yA^2

By solving this 2x2 linear system, you obtain the center point of the circle, inserting in any of the original equation gives the radius.

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51
1

There is a little known result giving the implicit equation of a circle through 3 points:

|Z   X   Y   1|
|Za  Xa  Ya  1|
|Zb  Xb  Yb  1| = 0
|Zc  Xc  Yc  1|

where we have defined Z:= X^2 + Y^2 for the sake of conciseness.

Computing the 3x3 minors, we develop into:

M00 Z + M10 X + M20 Y + M30 = 0

and, after normalization, we get the usual second degree equation:

X^2 + Y^2 + 2U X + 2V Y + W = 0

This can be rewritten as:

(X - U)^2 + (Y - V)^2 = U^2 + V^2 - W

immediately giving the center (U, V) = (-M10/2.M00, -M20/2.M00) and the radius R^2 = U^2 + V^2 - M30/M00.