找到一个圆(x和y位置)的,只有2个随机点和隆起的中心 [英] Find the center of a circle (x and y position) with only 2 random points and bulge
问题描述
我尝试找了一圈的中心。我的唯一信息是: 两个任意点的圆和圆凸起。到目前为止,我设法计算出圆(至少我觉得我做)的半径。生病后娄equasions香港专业教育学院沿用至今。
im trying to find the center of a circle. the only information I have is: Two random points in the circle and the circle bulge. So far i've manage to calculate the radius of the circle (at least i think i did). Ill post bellow the equasions ive used so far.
这些都只是随机值,并会改变用户输入)
these are just random values and will change on user input)
PointA(X = 10,Y = 15) PointB(X = 6,Y = 12)
PointA(x = 10, y = 15) PointB(x = 6, y = 12)
circle_bulge = 0.41
circle_bulge = 0.41
距离= PointB - PointA
distance = PointB - PointA
半径=(距离/ 4)*(circle_bulge +(1 / circle_bulge))
radius = (distance / 4) * (circle_bulge + (1 / circle_bulge ))
如果该数学是不正确,请让我知道,但请记住,我需要找到X和圆心
if this math is incorrect, please let me know, but keep in mind that i need to find the X and Y coordinates of the center of the circle
推荐答案
这是问题的一个画面:
根据定义的隆起是的 B 的= TG(阿尔法的/ 4)
By definition the bulge is b = tg(Alpha/4)
从三角公式:TG(2的角度的)= TG 2 (角度的)/(1-TG 2 (角度的))
From the trigonometric formula: tg(2 angle) = tg2(angle)/(1-tg2(angle))
适用于角度 = 阿尔法的/ 4,用凸起的定义:
applied to angle = Alpha/4 and using the definition of bulge:
TG(阿尔法的/ 2)=的 B 的 2 /(1-的 B 的 2 )
tg(Alpha/2) = b2/(1-b2)
在另一方面
TG(阿尔法的/ 2)=的取值 / ð的
tg(Alpha/2) = s/d
然后
取值 / ð = B 的 2 /(1-的 B 的< SUP> 2 )和
s/d = b2/(1-b2) and
ð = 取值的(1 B 的 2 )/ B 的< SUP> 2
d = s(1-b2)/b2
这使我们能够计算出的ð的原因的 B 的是已知的,取值的= ||的 B 的 - A 的|| / 2,其中||的 B 的 - 的 A 的||表示向量的范数的 B - A 的
which allows us to calculate d because b is known and s = ||B - A||/2, where ||B - A|| denotes the norm of the vector B - A.
现在,让我们计算
( U 的 v 的)=( B 的 - 的 A 的)/ ||的 B - A 的||
(u,v) = (B - A)/||B - A||
然后||( U 的 v 的)|| = 1,( v 的, - U 的)是正交的 B 的 - 的 A 的,我们有
Then ||(u,v)|| = 1, (v,-u) is orthogonal to B - A, and we have
C 的=( v 的, - U 的)的ð的+( A 的+ B 的)/ 2
C = (v,-u)d + (A+B)/2
更新
伪code计算中心
输入:
A = (a1, a2), B = (b1, b2) "two points"; b "bulge"
计算:
"lengths"
norm := sqrt(square(b1-a1) + square(b2-a2)).
s := norm/2.
d := s * (1-square(b))/square(b)
"direction"
u := (b1-a1)/ norm.
v := (b2-a2)/ norm.
"center"
c1 := -v*d + (a1+b1)/2.
c2 := u*d + (a2+b2)/2.
Return C := (c1, c2)
注意:的有两个解决方案为中心,另一个是
Note: There are two solutions for the Center, the other one being
c1 := v*d + (a1+b1)/2.
c2 := -u*d + (a2+b2)/2.
Return C := (c1, c2)
这篇关于找到一个圆(x和y位置)的,只有2个随机点和隆起的中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!