3
$\begingroup$

Here is my code for drawing the region bounded by the sphere $x^2+y^2+z^2=1$ and the cylinder $x^2+y^2=x$.

one=Plot3D[{-Sqrt[-x^2 - y^2 + 1], Sqrt[-x^2 - y^2 + 1]}, {x, -1, 1}, {y, -1, 1},  
  ColorFunction -> {Red, Red}, 
  RegionFunction -> Function[{x, y}, x^2 + y^2 < x]];

r[β_] := Cos[β];

two = ParametricPlot3D[{r[β] Cos[β], r[β] Sin[β], v Sqrt[1 - r[β]^2]}, 
  {β, 0, 2 π}, {v, -1, 1}];

Show[one, two, BoxRatios -> {1, 1, 1}]

The result:

enter image description here

I'd love to see some other techniques if folks would like to contribute.

$\endgroup$
2
5
$\begingroup$

I propose RegionPlot3D

RegionPlot3D[
  x^2 + y^2 + z^2 < 1 && x^2 + y^2 < x,
 {x, -1, 1}, {y, -1, 1}, {z, -1,1}, Mesh -> None, PlotPoints -> 100]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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