当两个球体相交时找到相交点 [英] Finding points of intersection when two spheres intersect

查看:303
本文介绍了当两个球体相交时找到相交点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有中心(xyz-在3维空间中)以及两个球A和B的半径.

I have the center (xyz - in 3 dimensional space) and the radius of two spheres A and B.

现在我必须找出这些球体相遇的一个点或一个以上的点.找出两个球体是否碰撞是很容易的,但是我如何找出两个球体的交点呢?

Now I have to figure out a point or more than 1 point where these spheres meet. It is fairly easy to figure out if the two spheres collide or not, but how do I find out the points of intersection of 2 spheres?

任何帮助将不胜感激.

Any help would be greatly appreciated.

推荐答案

如果较小球体的半径为A,较大球体的半径为B,并且它们的中心相距D个单位,则交点在一个圆上半径r的中心位于两个球体中心之间的一个点上,这是从较大球体中心开始的y个单位,从另一个球体中心开始的x个单位,其中

If the radius of the smaller sphere is A, and the bigger is B, and their centers are D units apart, then the points of intersection are on a circle of radius r centered on a point directly between the centers of the two spheres, which is y units from the center of the bigger sphere, and x units from the center of the other, where

y = 1/2(D +(B ^ 2-A ^ 2)/D)

y = 1/2 (D + (B^2 - A^2)/D)

x = 1/2(D-(B ^ 2-A ^ 2)/D)

x = 1/2 (D - (B^2 - A^2)/D)

半径

r = B ^ 2-x ^ 2 = A ^ 2-y ^ 2

r = B^2 - x^2 = A^2 - y^2

如果您需要该圆的方程式,最好的方法是将其表示为一组三个参数化方程式,其中x,y和z坐标分别表示为某个t的函数,表示半径矢量展开绕圈一次,从零到2PI ...

If you need the equation for this circle the best way is to represent it as a set of three parameterized equations, where the x, y, and z coordinates are each expressed a a function of some t, which represents the radius vector trraveling around the circle once, from zero to 2PI...

要构建这些方程,请考虑在垂直于两个球体之间的直线的2D平面上表示从中心开始的半径r的点.

To construct these equations, think about expressing the point which is the radius r from the center, on the 2D plane which is normal to the line between the two spheres.

查看此链接,了解有关如何使用iedas的一些想法.做到这一点.

Check out this link for some iedas on how to do this..

推导如下:在两个球体的中心之间画一条线.将其标记为D
将这条线上的一个点指定为最终解决方案圆的中心,并将其标记为点O
将D的较小部分标记为x,将较大部分标记为y
从O垂直到D画一条线,距离r代表溶液圆的半径
将此半径的末端标记为Q 现在在较大球体的中心到Q之间绘制B,从较小球体的中心到Q之间绘制A

Derivation is as follows: draw a line between the centers of the two spheres. Label it as D
Designate a point on this line as the center of the final solution circle label it as point O
Label the smaller portion of D as x, and the large portion as y
draw a line from O perpindicular to D, for some distance r to represent the radius of the solution circle
Label the end of this radius as Q Now draw B between the center of the larger sphere to Q and A from the center of smaller sphere and Q

来自毕达哥拉斯:
B ^ 2 = y ^ 2 + r ^ 2和A ^ 2 = x ^ 2 + r ^ 2
因此,在消除了r和一些代数之后,
y-x =(B ^ 2-A * 2)/(x + y)
但是x + y = D所以

From Pythagoras:
B^2 = y^2 + r^2 and A^2 = x^2 + r^2
so, after eliminating r and a bit of algebra,
y-x = (B^2 - A*2) / (x+y)
But x+y = D so,

y-x =(B ^ 2-A * 2)/D

y-x = (B^2 - A*2) / D

在上面加上等式x + y = D消除了x,得到

Adding the equation x+y=D to the above eliminates the x, giving

2y = D +(B ^ 2-A * 2)/D

2y = D + (B^2 - A*2) / D
or,

y = 1/2 (  D  + (B^2 - A*2) / D  )

这篇关于当两个球体相交时找到相交点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆