在MATLAB中绘制两个球体的相交体积? [英] Draws the intersecting volume of two spheres in MATLAB?

查看:822
本文介绍了在MATLAB中绘制两个球体的相交体积?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MATLAB中有两个球体的方程,例如

I have the equations of two spheres in MATLAB, like

(x-x0)^2+(y-y0)^2+(z-z0)^2=R0^2
(x-x1)^2+(y-y1)^2+(z-z1)^2=R1^2

它们有一个相交的部分(我发现类似的图片可以在网络上解释我的意思,如下所示)

They have an intersecting part (I find a similar picture which could explain my meaning on the web like below)

现在,我只想绘制这两个球的空间相交体积(如上面的示例图像中带有红线的曲面之间的3D部分) 也许我可以在MATLAB中使用命令'surface'绘制出构成相交体积的两个曲面?我不知道该怎么做....

Now I would like to only draw the spatial intersecting volume of these two spheres (like the 3D part between the curved faces with red lines in the sample image above) Maybe I could use the command 'surface' in MATLAB to draw out those two curved faces which make up the intersecting volume? I do not know how to do it....

此外,在删除那些相交的部分之后,我还想绘制这两个球体

Moreover, I also would like to draw these two spheres after erasing out those intersecting parts

也就是说,我的目标是:分别画出这两个球体的相交和不相交的部分.

That is, my goal: drawing out the intersecting and non-intersecting part of these two spheres individually.

有人可以帮我吗?

谢谢!

推荐答案

答案在

The answer is given in great detail at Wolfram. In brief, rather than copypaste all the equations:

1)计算两个球体表面的相交圆.

1) calculate the circle of intersection of the two sphere's surfaces.

2)确定该圆在每个球体上的位置.

2) determine the location of that circle on each sphere.

3)计算该圆的每个球体的球形帽的体积,并将这两个体积相加得到透镜".

3) Calculate the volume of each sphere's spherical cap for that circle and add the two volumes to get the "lens."

我建议将其移至Math.SE,因为这是一个数学问题,因此在Matlab中进行编码很简单.

I am recommending this be moved to Math.SE because it is a math problem, and coding it in Matlab is trivial.

这篇关于在MATLAB中绘制两个球体的相交体积?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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