本文介绍了与两点相交的圆的中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个二维平面上给定两个点,并且与这两个点相交的一个半径为r的圆,计算该圆的中心的公式是什么?





我希望整个计算可以在没有三角函数的情况下完成。我以整数坐标开始,并以整数坐标结束,如果有帮助。

解决方案

不知道这是否正确请问这个问题,但是:



let:

  q = sqrt ((x2-x1)^ 2 +(y2-y1)^ 2)
x3 =(x1 + x2)/ 2
y3 =(y1 + y2)/ 2

第一圈:

  x = x3 + sqrt(r ^ 2-(q / 2)^ 2)*(y1-y2)/ q 
y = y3 + sqrt x1)/ q

第二圈:

<$ (q 2)^ 2)*(y 1-y 2)/ q
y = y 3 - sqrt(r ^ 2-( q / 2)^ 2)*(x2-x1)/ q


Given two points in a 2D plane, and a circle of radius r that intersects both of those points, what would be the formula to calculate the centre of that circle?

I realise there would two places the circle can be positioned. I would want the circle whose centre is encountered first in a clockwise direction when sweeping the line that joins the two points around one of those points, starting from an arbitrary angle. I guess that is the next stage in my problem, after I find an answer for the first part.

I'm hoping the whole calculation can be done without trigonometry for speed. I'm starting with integer coordinates and will end with integer coordinates, if that helps.

解决方案

Not sure if this is the right place to ask this but:

let:

q = sqrt((x2-x1)^2 + (y2-y1)^2)
x3 = (x1+x2)/2
y3 = (y1+y2)/2

first circle:

x = x3 + sqrt(r^2-(q/2)^2)*(y1-y2)/q
y = y3 + sqrt(r^2-(q/2)^2)*(x2-x1)/q

Second Circle:

x = x3 - sqrt(r^2-(q/2)^2)*(y1-y2)/q
y = y3 - sqrt(r^2-(q/2)^2)*(x2-x1)/q

Here

这篇关于与两点相交的圆的中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 00:12