0
$\begingroup$

I am trying to plot the circle is intersection of the sphere with center O(0,0,0) and radius R and the plane z = h. I tried

R = 4;
h = R - 5;
p = {0, 0, h};
v = {0, 0, 1};
sph = Sphere[{0, 0, 0}, R];
hp = Hyperplane[p, v];
reg = RegionIntersection[sph, hp];
Graphics3D[{{Opacity[.5], sph}, {Opacity[.5], hp}, {Opacity[.5], 
   reg}}, Boxed -> False]

I cannot get the result. How can I get correct result?

$\endgroup$
4
  • $\begingroup$ DiscretizeRegion@reg $\endgroup$
    – cvgmt
    Aug 2 at 3:01
  • $\begingroup$ Never use upper-case letters for your variables (e.g., $R$), as they can conflict with internal naming conventions. $\endgroup$ Aug 2 at 3:25
  • $\begingroup$ @DavidG.Stork Thank you very much. $\endgroup$ Aug 2 at 3:28
  • 1
    $\begingroup$ Graphics3D[{{Opacity[.5], sph}, {Opacity[.5], hp}, {Opacity[.5], HighlightMesh[ DiscretizeRegion[reg], {Style[1, Thickness[.01], Red], Style[0, None]}]}}, Boxed -> False] $\endgroup$
    – cvgmt
    Aug 2 at 4:06

Your Answer

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

Browse other questions tagged or ask your own question.