3

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.

xyz
  • 605
  • 4
  • 38
  • 117
David
  • 14,883
  • 4
  • 44
  • 117

1 Answers1

5

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

xyz
  • 605
  • 4
  • 38
  • 117