Say I have a real valued function on the 2-sphere, f:S2→R. I would like to visualize the sets ΓA={x∈S2∣f(x)>A} in 3D.
In particular I would like to do this first for functions of the form f(x1,x2,x3)=πabc√a2x21+b2x22+c2x23
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