How can I make a 3D plot of
$$(x^2+y^2-1)^2+(y^2+z^2-1)^2+(x^2+z^2-1)^2=0$$
Does the above equation describes the same region as
$$x^2+y^2\le 1\wedge y^2+z^2\le 1\wedge x^2+z^2\le 1$$
ContourPlot3D
seems to do it
f = (x^2 + y^2 - 1)^2 + (y^2 + z^2 - 1)^2 + (x^2 + z^2 - 1)^2;
ContourPlot3D[f, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
ContourStyle -> Opacity[1], Mesh -> None, Contours -> {1}]
There are many other options you can try for this command. You can change the options for Contours
Opacity
, and Mesh
, etc.
Answer for comment:
RegionPlot3D[
x^2 + y^2 <= 1 && y^2 + z^2 <= 1 && x^2 + z^2 <= 1,
{x, -2, 2}, {y, -2, 2}, {z, -2, 2}]
$(x^2+y^2-1)^2+(y^2+z^2-1)^2+(x^2+z^2-1)^2=0$
is satisfied by a set of points. This can be established:
f = (x^2 + y^2 - 1)^2 + (y^2 + z^2 - 1)^2 + (x^2 + z^2 - 1)^2;
FullSimplify[Reduce[f == 0, {x, y, z}, Reals]]
Reduce[x^2 + y^2 == 1 && z^2 + y^2 == 1 && x^2 + z^2 == 1, {x, y, z}]
i.e.
(x == -(1/Sqrt[2]) || x == 1/Sqrt[2]) && (y == -(1/Sqrt[2]) ||
y == 1/Sqrt[2]) && (z == -(1/Sqrt[2]) || z == 1/Sqrt[2])
Note as expected the last 2 results are equivalent. f=0, is a set of 8 points (vertices of a cube). This is separate issue for surfaces of f=n that can be explored by ContourPlot3D
.
This can be seen in many ways:
ir = ImplicitRegion[
x^2 + y^2 == 1 && z^2 + y^2 == 1 && x^2 + z^2 == 1, {x, y, z}];
dr = DiscretizeRegion[ir]
This can be visualised by using ContourPLot3D
(as alluded to by Nasser ) imagine the limiting process to contour value 0:
ContourPlot3D[f, {x, -3, 3}, {y, -3, 3}, {z, -3, 3},
Contours -> {0.1, 0.2, 0.4},
ContourStyle -> {Opacity[0.2], Opacity[0.2], Opacity[0.2]},
Mesh -> False, PlotLegends -> Automatic]
Just another way to see this:
pts = Tuples[{-1/Sqrt[2], 1/Sqrt[2]}, 3];
Graphics3D[{Opacity[0.4], Cylinder[{{0, 0, -1}, {0, 0, 1}}, 1],
Cylinder[{{0, -1, 0}, {0, 1, 0}}, 1],
Cylinder[{{-1, 0, 0}, {1, 0, 0}}, 1],
Sphere[{0, 0, 0}, Sqrt[3/2]],
Opacity[1], PointSize[0.02], Red, Point[pts]}, Boxed -> False,
Background -> Black]
ContourPlot
. $\endgroup$ContourPlot3D
is not a solution. See ubpdqn's answer. $\endgroup$ParametricPlot3D
like this i.sstatic.net/hEL0u.png. Code dump here: chat.stackexchange.com/transcript/message/21045469#21045469 $\endgroup$