两个曲面相交,只显示相交部分的图象。然后两个曲面用不同的颜色作色,结果凹进去的那个曲面的颜色显示不出来。是我的代码有问题吗?求高人指点!!!
ContourPlot3D[{x^2/2 + y^2 + z^2/2 - 1 == 0,
z == x^2 + Sin[y]}, {x, -2, 2}, {y, -2, 2},
{z, -2, 2}, MeshFunctions -> Function[{x, y, z},
x^2/2 + y^2 + z^2/2 - 1 - (z - x^2 - Sin[y])],
Mesh -> {{0}}, MeshStyle -> {Red, Thick},
AxesLabel -> {"x", "y", "z"},
RegionFunction -> Function[{x, y, z},
x^2/2 + y^2 + z^2/2 - 1 <= 0 &&
z <= x^2 + Sin[y]], ContourStyle ->
{{Opacity[0.6], Yellow}, {Opacity[0.6], Blue}}]
图像显示如下
ContourPlot3D[{x^2/2 + y^2 + z^2/2 - 1 == 0,
z == x^2 + Sin[y]}, {x, -2, 2}, {y, -2, 2},
{z, -2, 2}, MeshFunctions -> Function[{x, y, z},
x^2/2 + y^2 + z^2/2 - 1 - (z - x^2 - Sin[y])],
Mesh -> {{0}}, MeshStyle -> {Red, Thick},
AxesLabel -> {"x", "y", "z"},
RegionFunction -> Function[{x, y, z},
x^2/2 + y^2 + z^2/2 - 1 <= 0 &&
z <= x^2 + Sin[y]], ContourStyle ->
{{Opacity[0.6], Yellow}, {Opacity[0.6], Blue}}]
图像显示如下