找到弧的算法,其中心,半径和角度给出3个点

时间:2014-04-01 16:44:57

标签: algorithm math

给出3分A,B和C

enter image description here

我怎样才能找到并且从A开始,从C结束并通过B;它的中心坐标,半径和角度为r和r'?

enter image description here

6 个答案:

答案 0 :(得分:6)

有几种方法可以做到这一点。这是一种算法:

  1. 获取您的COORDS

    A = {xA,yA}

    B = {xB,yB}

    C = {xC,yC}

    d = {xd,yd}

  2. 计算AB和BC线的中点

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

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

  3. 找到AB和BC线的斜率

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

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

  4. 构建贯穿中间点PERPENDICULAR到AB和BC的行(感谢Yves抓住否定!)

    Slope_perp_AB = - (slope_AB)^( - 1)

    Slope_perp_BC = - (slope_BC)^( - 1)

    ***带有Slope_perp_AB的行贯穿mid_AB

    ***带有Slope_perp_BC的线路贯穿mid_BC

  5. 设置两个方程彼此相等并求解找到交点! 这给你点d = {xd,yd} !!!

  6. 使用中心点d!

    计算半径和角度现在是微不足道的

答案 1 :(得分:5)

圆的中心与三个给定点等距:

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

从第二个和第三个成员中减去第一个成员,我们在重组后得到:

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

这两个未知数的两个方程的线性系统很容易用Cramer的规则求解。

可以使用围绕中心的笛卡尔到极坐标变换找到半径和角度:

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

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

但是你仍然会遗漏一件事:弧的相关部分是什么?小转弯还是大转弯?从TaTb或从Tb2 Pi再到Ta + 2 Pi,还是什么?答案远不如看似那么明显,尝试一下(因为三个角度TaTbTc不确定为2 Pi的倍数,你无法对它们进行排序)!

提示:考虑三角形ABC区域的符号,恰好是系统决定因素的一半。它会告诉你B是否位于AC的左侧或右侧。

答案 2 :(得分:4)

第1步

找到AB和BC的垂直平分线。

第2步

找到这些线相交的点。

您将找到的点是您想要的圆圈的中心。

第3步

计算从步骤2中找到的中心开始的三个点之一的距离。这将是您的圆的半径。

注意点A,B和C不得在同一行。在执行步骤1到3之前,您必须检查这一点。

答案 3 :(得分:2)

对此的解决方案几乎与“非最适合非超定系统的圈子”相同。由于你的三个点正好位于以(0,0)(给定)为中心的圆弧上,因此系统可以精确求解而不需要最小二乘近似。

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/   

<强>参考


  1. 查找给定三分的圆圈中心,访问2014-04-01,<http://mathforum.org/library/drmath/view/55239.html>

答案 4 :(得分:1)

你有三个方程来确定三个未知数xM,yM和R,

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

等。从B和C方程中减去A方程得出

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

通过求解这个2x2线性系统,可以得到圆的中心点,插入任何原始方程给出半径。

答案 5 :(得分:1)

有一个鲜为人知的结果,通过3个点给出一个圆的隐式方程:

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

我们为了简洁而定义了Z:= X^2 + Y^2

计算3x3未成年人,我们发展成:

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

并且,在归一化之后,我们得到通常的二度方程:

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

这可以改写为:

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

立即给出中心(U, V) = (-M10/2.M00, -M20/2.M00)和半径R^2 = U^2 + V^2 - M30/M00