Mathematica RegionPlot 在单位球面上? [英] Mathematica RegionPlot on the surface of the unit sphere?

查看:68
本文介绍了Mathematica RegionPlot 在单位球面上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mathematica 中使用 RegionPlot3D 来可视化一些不等式.由于不等式在坐标中是齐次的,它们由它们与单位球体的交点唯一确定.这给出了球体表面上的一些二维区域,我想绘制这些区域.我的问题是如何?

如果需要,我很乐意提供一些 Mathematica 代码;虽然我认为答案应该独立于我试图绘制的区域的细节.

提前致谢!

更新:如果有人感兴趣,我最近完成了一篇论文,我在下面使用了 Sasha 的答案来绘制一些图.这篇论文是.您可以在 ParametricPlot3D.

Show[{ParametricPlot3D[{Sin[th] Cos[ph], Sin[th] Sin[ph],cos[th]}, {th, 0, Pi}, {ph, 0, 2 Pi},区域功能 ->函数[{x, y, z}, And[x^3 {-1, 1}, PlotStyle ->红色的],Graphics3D[{Opacity[0.2], Sphere[]}]}]

I am using RegionPlot3D in Mathematica to visualise some inequalities. As the inequalities are homogeneous in the coordinates they are uniquely determined by their intersection with the unit sphere. This gives some two-dimensional regions on the surface of the sphere which I would like to plot. My question is how?

If requested I would be more than happy to provide some Mathematica code; although I believe that the answer should be independent on the details of the regions I'm trying to plot.

Thanks in advance!

Update: In case anyone is interested, I have recently finished a paper in which I used Sasha's answer below in order to make some plots. The paper is Symmetric M-theory backgrounds and was arXived last week. It contains plots such as this one:

Thanks again!

解决方案

Please look into RegionFunction. You can use your inequalities verbatim in it inside ParametricPlot3D.

Show[{ParametricPlot3D[{Sin[th] Cos[ph], Sin[th] Sin[ph], 
    Cos[th]}, {th, 0, Pi}, {ph, 0, 2 Pi}, 
   RegionFunction -> 
    Function[{x, y, z}, And[x^3 < x y z + z^3, y^2 z < y^3 + x z^2]], 
   PlotRange -> {-1, 1}, PlotStyle -> Red], 
  Graphics3D[{Opacity[0.2], Sphere[]}]}]

这篇关于Mathematica RegionPlot 在单位球面上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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