Mathematica RegionPlot on the surface of the unit sphere?

后端 未结 4 1679
无人共我
无人共我 2021-02-13 22:49

I am using RegionPlot3D in Mathematica to visualise some inequalities. As the inequalities are homogeneous in the coordinates they are uniquely determined by their

4条回答
  •  清歌不尽
    2021-02-13 23:51

    Here's the simplest idea I could come up with (thanks to belisarius for some of the code).

    • Project the inequalities onto the sphere using spherical coordinates (with θ=q, φ=f).
    • Plot these as a flat region plot.
    • Then plot this as a texture the sphere.

    Here's a couple of homogeneous inequalities of order 3

    ineq = {x^3 < x y^2, y^2 z > x z^2};
    
    coords = {x -> r Sin[q] Cos[f], y -> r Sin[q] Sin[f], z -> r Cos[q]}/.r -> 1
    
    region = RegionPlot[ineq /. coords, {q, 0, Pi}, {f, 0, 2 Pi}, 
      Frame -> None, ImagePadding -> 0, PlotRangePadding -> 0, ImageMargins -> 0]
    

    flat region

    ParametricPlot3D[coords[[All, 2]], {q, 0, Pi}, {f, 0, 2 Pi}, 
     Mesh -> None, TextureCoordinateFunction -> ({#4, 1 - #5} &), 
     PlotStyle -> Texture[Show[region, ImageSize -> 1000]]]
    

    animation

提交回复
热议问题