绕着另一个圆旋转一个圆

发布于 2024-09-15 08:01:48 字数 618 浏览 9 评论 0原文

简短的问题:给定一个点 P 和一条线段 L,如果保证存在这样一个点,我如何找到 L 上距离 P 恰好为 X 距离的点?

提出这个问题的较长方法是使用图像。给定两个圆,一静态一动态,如果将动态圆沿直线移动到静态圆,就很容易确定接触点(参见 1,绿点)。

现在,如果将动态圆以一定角度移向静态圆,则确定接触点会变得更加困难(参见 2,紫色点)。那部分我已经完成了。我想做的是,确定接触点后,减小角度并确定新的接触点(参见3、4,红点)。

在#4 中,您可以看到角度减小了不到一半,并且新的接触点位于直线点和原始点之间的中间位置。在#7 中,您可以看到角度被平分,但新的接触点向直线点移动的距离远超过一半。

Example

就我而言,我总是想将角度减小到原始值的 5/6,但是原始角度和距离圆圈之间是可变的。这些圆的半径都相同。减小角度后我需要的实际数据是动态圆的新中心和静态圆之间的向量,即3、4、6和7中的蓝线,如果这样可以使计算更容易的话。

到目前为止,我知道我必须沿着紫色圆圈为中心的线向静态圆圈的中心移动动态圆圈。然后圆圈必须直接移回动态圆圈的原始位置。困难的部分是准确地知道它必须向后移动多远才能刚好接触到另一个圆圈。

Short question: Given a point P and a line segment L, how do I find the point (or points) on L that are exactly X distance from P, if it guaranteed that there is such a point?

The longer way to ask this question is with an image. Given two circles, one static and one dynamic, if you move the dynamic one towards the static one in a straight line, it's pretty easy to determine the point of contact (see 1, the green dot).

Now, if you move the dynamic circle towards the static circle at an angle, determining the point of contact is much more difficult, (see 2, the purple dot). That part I already have done. What I want to do is, after determining the point of contact, decrease the angle and determine the new point of contact (see 3, 4, the red dot).

In #4, you can see the angle is decreased by less than half, and the new point of contact is half-way between the straight-line point and the original point. In #7, you can see the angle is bisected, but the new point of contact moves much farther than half way back towards the straight-line point.

Example

In my case, I always want to decrease the angle to 5/6ths its original value, but the original angle and distance between the circles are variable. The circles are all the same radius. The actual data I need after decreasing the angle is the vector between the new center of the dynamic circle and the static circle, that is, the blue line in 3, 4, 6, and 7, if that makes the calculation any easier.

So far, I know I have to move the dynamic circle along the line that the purple circle is a center of, towards the center of the static circle. Then the circle has to move directly back towards the original position of the dynamic circle. The hard part is knowing exactly how far back it has to move so that it's just touching the other circle.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苄①跕圉湢 2024-09-22 08:01:48

为了回答你的简短问题,如果你在笛卡尔平面上,那么找到 L 所在线的方程(给定 L 的两个端点,这很简单)。找到穿过 P 的垂直于所述直线的方程(这是通过取斜率的负倒数,代入 P 的 x 和 y 值,并求解截距来完成的)。然后通过将它们的方程用作单个方程组(x 和 y 相等)来找到两条垂直线的交点。然后求交点与点 P(三角形的一条边)之间的距离。最后,根据给出的距离和距离 X,使用毕达哥拉斯定理求出三角形另一条边的距离。现在你要寻找的点是 L 上的一点,也是 L 所在直线上的点。因此,利用刚刚获得的距离、之前找到的交点以及 L 线的方程,您可以找到所需点的坐标。这样的点最多只能有 2 个,因此您只需测试找到的点的坐标是否实际上在 L 上,或者超出 L 但仍在其直线上。很抱歉回答很长,如果您想要几何解释而不是代数解释。

To answer your short question, if you are on the Cartesian plane, then find the equation of the line L is sitting on (given the two endpoints of L, this is simple). Find the equation of the perpendicular to said line, which passes through P (this is done by taking the negative inverse of the slope, plugging in P's x and y values, and solving for the intercept). Then find the point where the two perpendicular lines intersect by using their equations as a single system of equations (with x's and y's equal). Then find the distance between the point of intersection and the point P, which is one leg of a triangle. Finally, with that distance and the distance X you are given, use Pythagorean theorem to find the distance of the other leg of the triangle. Now the point you are looking for is a point on L, and also on the line on which L sits. So using the distance you just obtained, the intersection point you had found before, and the equation of L's line, you can find the desired point's coordinates. There can only be a maximum of 2 such points, so all you have to test for is whether the coordinates of the points found are actually on L, or beyond L but still on its line. Sorry for the long answer and if you wanted a geometric explanation rather than an algebraic one.

画一个与静止圆同心的圆,半径为两个半径之和。与移动圆中心的平移线有两个交点。接触时移动圆的中心位置是这两个交点中较靠近的位置。

Draw a circle with the same centre as the stationary circle and the radius of the sum of both radii. There are two intersections with the translation line of the moving circle's centre. The place of the moving circle's center at the time of contact is the closer of those two intersections.

我也只是我 2024-09-22 08:01:48

令线段的两端为 AB,固定圆的中心为 C。设两个圆的半径均为r。设碰撞时刻的移动圆的中心为D。我们有一个三角形 ACD,其中我们知道:距离 AC,因为它是常数,角度 DAC,因为这就是你变化,距离 CD,正好是 2r。理论上,两条边和角度应该可以让你得到三角形的所有其余部分......

Let the ends of your segment be A and B, and the center of your stationary circle be C. Let the radius of both circles be r. Let the center of the moving circle at the moment of collision be D. We have a triangle ACD, of which we know: the distance AC, because it is constant, the angle DAC, because that's what you are changing, and the distance CD, which is exactly 2r. Theoretically, two sides and angle should let you get all the rest of a triangle...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文