计算两个圆上两点之间的切线弧

发布于 2024-10-01 04:50:22 字数 619 浏览 1 评论 0原文

如何计算两个圆之间的弧度?圆弧必须与圆上的两点相切。

这是一张说明它的图片。我正在尝试编码并计算橙色弧和蓝色弧。

alt text

更多详细信息:

您的小程序应该有 2 种模式:2D 和 3D。用户应该能够通过按空格键在它们之间进行切换。在 2D 模式下,用户可以编辑四个控制点 A、B、C 和 D 的位置,并且应该看到由这些点定义的 4 个圆弧,如下所示。红色圆弧位于以 A 为圆心、以 ||AB|| 为半径的圆上。绿色圆弧位于以 C 为圆心、以 ||CD|| 为半径的圆上。橙色圆弧位于支撑圆上,该圆与红色圆弧在 B 处的支撑圆相切,并且在点 E 处与绿色圆相切,您的代码必须计算该点。该支撑圆不应将 A 和 C 分开(即,A 和 C 必须同时在该圆内或在该圆外)。类似地,蓝色圆弧位于不将 A 和 C 分开的圆上,并且与 D 处绿色圆弧的支撑圆相切,并且在程序必须在某个点 F 处与红色圆弧的支撑圆相切。计算。红色弧线顺时针从 F 到 B。橙色弧线从 B 到 E。绿色弧线从 E 到 D。蓝色弧线从 D 回到 F。这四条弧线形成区域 S 的平滑边界飞机。请注意,根据控制点的位置,橙色和蓝色弧可能各自是凹的或凸的。下图中,蓝色的弧线是凹的。 (如上图)

How can I calculate the arc between two circles? The arc must be tangent to the two points on the circles.

Here is a picture illustrating it. I'm trying to code and calculate the orange arc and the blue arc.

alt text

more details:

Your applet should have 2 modes: 2D and 3D. The user should be able to switch between them by pressing the space bar. In the 2D mode, the user can edit the position of four control points A, B, C and D and should see 4 circular arcs defined by these points as follows. The red arc lies on a circle of center A and radius ||AB||. The green arc lies on a circle of center C and radius ||CD||. The orange arc lies on a supporting circle that is tangent to the supporting circle of the red arc at B and also tangent to the green circle at a point E, which your code must compute. This supporting circle should not separate A and C (i.e., A and C must either be both in that circle or out of it). Similarly, the blue arc lies on a circle that does not separate A and C and that is tangent to the supporting circle of the green arc at D and is also tangent to the supporting circle of the red arc at some point F which your program must compute. The red arc runs clockwise from F to B. The orange arc runs from B to E. The green arc runs from E to D. The blue arc runs from D back to F. These four arcs form a smooth boundary of a region S of the plane. Notice that depending on the position of the control points, the orange and blue arcs may each be either concave or convex. In the figure below, the blue arc is concave. (pictured above)

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

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

发布评论

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

评论(3

空名 2024-10-08 04:50:22

有很多“相切圆”!

替代文本

There are many "tangent circles" !

alt text

冬天旳寂寞 2024-10-08 04:50:22

一般来说,你不能。通过AB和CE画直线,并将它们延伸到交点。称交点为 M。当且仅当 BM = EM 时,您可以通过 B 和 E 绘制与圆相切的圆弧。

Generally speaking, you can't. Draw straight lines through AB and CE, and extend them to the point of intersection. Call the intersection M. You can draw an arc through B and E that is tangent to circles if and only if BM = EM.

默嘫て 2024-10-08 04:50:22

设 G 为 B 和 E 之间的圆弧的圆心,H 为 F 和 D 之间的圆弧的圆心。

关键点是,与圆相交的直线当且仅当垂直于交点处的半径。这意味着如果有两个相切的圆,则切点和圆心共线。

因此,这意味着中心 G 是 B 和 A 定义的直线与 E 和 C 定义的直线的交点。同样,中心 H 是 A 和 F 定义的直线与 C 和 C 定义的直线的交点。 D.

给定这些圆心,只需从圆心到切点的距离即可确定两个圆的半径。从那里,您可以使用标准方法根据给定的端点和它所属的圆来绘制圆弧。

Let G be the center of the circle for the arc between B and E and H the circle for the arc between F and D.

The key point is that a line that intersects a circle is a tangent line if and only if it is perpendicular to the radius at the intersection point. This means that if you have two circles that are tangent, then the tangent point and the centers of the circles are collinear.

So this means that the center G is the intersection of the line defined by B and A and the line defined by E and C. Similarly, the center H is the intersection of the line defined by A and F and the line defined by C and D.

Given these centers, you can determine the radii of the two circles just from the distance from the center to the tangent point. From there you can use standard methods to draw the arc given its endpoints and the circle it is part of.

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