1
$\begingroup$

I am trying to graph the following surfaces so that they are all visible in the same place:

z == y^2 - y^3 

on -3.5 < x < 3.5, -2 < y < 2, -3 < z < 3

 (x-3)^2 + y^2 == 0.25 

on -3.5 < x < 3.5, -2 < y < 2, -3 < z < 0

(x+3)^2 + y^2 == 0.25 

on -3.5 < x < 3.5, -2 < y < 2, -3 < z < 0

How can I graph these three functions on these different intervals?

$\endgroup$
1
  • 3
    $\begingroup$ Show[ContourPlot3D[ z == y^2 - y^3, {x, -3.5, 3.5}, {y, -2, 2}, {z, -3, 3}], ContourPlot3D[{(x - 3)^2 + y^2 == 0.25, (x + 3)^2 + y^2 == 0.25}, {x, -3.5, 3.5}, {y, -2, 2}, {z, -3, 0}]] $\endgroup$
    – cvgmt
    Commented Dec 9, 2023 at 1:41

1 Answer 1

0
$\begingroup$

use Show as @cvgmt said

Show[ContourPlot3D[z == y^2 - y^3, {x, -3.5, 3.5}, {y, -2, 2}, {z, -3,
     3}], ContourPlot3D[(x - 3) ^ 2 + y^2 == 0.25, {x, -3.5, 3.5}, {y, -2,
     2}, {z, -3, 0}], ContourPlot3D[(x + 3) ^ 2 + y^2 == 0.25, {x, -3.5, 
    3.5}, {y, -2, 2}, {z, -3, 0}]]

enter image description here

and a variant.

Show[Plot3D[y^2 - y^3, {x, -3.5, 3.5}, {y, -2, 2}, PlotRange -> All],
     Graphics3D @ Cylinder[{{3, 0, -3}, {3, 0, 0}}, 0.5], Graphics3D @ Cylinder[
    {{-3, 0, -3}, {-3, 0, 0}}, 0.5]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.