Say I have a real valued function on the 2-sphere, $f:S^2\to \mathbb{R}$. I would like to visualize the sets $\Gamma_A=\{x\in S^2 \mid f(x) > A\}$ in 3D.
In particular I would like to do this first for functions of the form $f(x_1,x_2,x_3) = \frac{\pi abc}{\sqrt{a^2x_1^2+b^2x_2^2+c^2x_3^2}}$
Is it possible to do this using Mathematica (or any other similar program)? I am pretty new at Mathematica.
Answer
You can use ParametricPlot3D
with Mesh*
options:
ClearAll[f]
f[x1_, x2_, x3_, a_, b_, c_] := π a b c/Sqrt[a^2 x1^2 + b^2 x2^2 + c^2 x3^2]
Manipulate[ParametricPlot3D[{Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}, {u, 0, 2 π}, {v, 0, π},
MeshFunctions -> {f[#1, #2, #3, a, b, c] &},
PlotStyle -> Directive[Opacity[0.5], Yellow], Mesh -> {{aA}},
MeshStyle -> Directive[Thick, Black],
MeshShading -> {Directive[Opacity[.5], Red], Automatic},
PlotPoints -> 100,PerformanceGoal -> {"Speed", "Quality"}],
{{aA, 0.1}, 0, 1}, {{a, .1}, 0, 1}, {{b, .1}, 0, 1}, {{c, .1}, 0, 1}]
Comments
Post a Comment