plotting – 3D plot of Intersection of sphere with plane (basic)


We use the implicit exprssion of plane. The normal of plane is Cross(b-a,c-a)

({x, y, z} - a).Cross(b - a, c - a)==0

And we also use the implicit expression of sphere,here {5,0,0} is the sphere center and 10 is radius.

Norm({x, y, z} - {5, 0, 0}) - 10==0

Norm({x, y, z} - {5, 0, 0}) - 10 as MeshFunction

x = InfiniteLine({{0, 0, 0}, {1, 0, 0}});
y = InfiniteLine({{0, 0, 0}, {0, 1, 0}});
z = InfiniteLine({{0, 0, 0}, {0, 0, 1}});
plane = InfinitePlane({{1/2, 0, 0}, {1/2, 1, 0}, {1/2, 0, 1}});


sphere = Sphere({5, 0, 0}, 10);
sphereOrigin = Point({5, 0, 0});

fig = Graphics3D({{Thick, x}, {Thick, y}, {Thick, z}, {Opacity(0.15), 
     plane}, {Opacity(0.15), sphere}, {PointSize(Large), Red, 
     sphereOrigin}}, Boxed -> False);

{a, b, c} = {{1/2, 0, 0}, {1/2, 1, 0}, {1/2, 0, 1}};
circle3 = 
  ContourPlot3D(({x, y, z} - a).Cross(b - a, c - a) == 0, {x, -15, 
    15}, {y, -15, 15}, {z, -15, 15}, 
   MeshFunctions -> 
    Function({x, y, z}, Norm({x, y, z} - {5, 0, 0}) - 10), 
   Mesh -> {{0}}, MeshStyle -> {Thick,Red}, ContourStyle -> None, 
   BoundaryStyle -> None);
Show(fig, circle3)

enter image description here