The search algorithm for the arc, its center, radius and angles is set to 3 points

Given 3 points A, B and C

enter image description here

How to find the arc starting with A ends in C and passes through B; its central coordinates, radius and angles for r and r '?

enter image description here

+8
math algorithm
source share
6 answers

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

  • Get your COORDS

    A = {xA, yA}

    B = {xB, yB}

    C = {xC, yC}

    d = {xd, yd}

  • Calculate midpoints of lines AB and BC

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

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

  • Find the slopes of the lines AB and BC

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

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

  • Build lines through the midpoints of PERPENDICULAR to AB and BC (thanks Yves for the trick!)

    Slope_perp_AB = - (slope_AB) ^ (- 1)

    Slope_perp_BC = - (slope_BC) ^ (- 1)

    *** A line with Slope_perp_AB goes through mid_AB

    *** A line with Slope_perp_BC goes through mid_BC

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

The calculation of the radius and angles is now trivial with the center point d!

+5
source share

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

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

Subtracting the first term from the second and 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 easily solved using the Cramer rule.

Radius and angles can be found using the Cartesian-polar transformation 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 corresponding part of the arc? Less or more than half the turnover? 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 not defined to a multiple of 2 Pi , and you cannot sort them)!

Hint: consider the sign of the region of triangle ABC, exactly half the determinant of the system. It will tell you whether B is on the left or right of the AC.

+5
source share

Step 1

Find the perpendicular bisector AB and BC.

Step 2

Find the intersection point of these lines.

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

Step 3

Calculate the distance of one of the three points from the center found in step 2. This will be the radius of the circle.

NOTE Points A, B, and C must not be on the same line. You must verify this before performing steps 1 to 3.

+4
source share

The solution to this is almost identical to the solution to the โ€œbest fit circle for an undetermined system. Since you have three points that are located exactly on an arc located in a circle centered at (0,0) (given), the system can be solved exactly, and does not require 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 - ie (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: (xh)^2 + (yk)^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


+2
source share

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

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

etc .. Subtracting equation A from equations B and C, we obtain

 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 

Solving this 2x2-linear system, you get the center point of the circle by inserting a radius into any of the original equation.

+1
source share

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

 |ZXY 1| |Za Xa Ya 1| |Zb Xb Yb 1| = 0 |Zc Xc Yc 1| 

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

Calculating the 3x3 minors, we go to:

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

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

 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 .

+1
source share

All Articles