找两个简单的圆柱面
surfaces =ContourPlot3D[{y^2 + z^2 == 1, x^2 + z^2 == 4}, {x, -3, 3}, {y, -2,2}, {z, -3, 3}, ContourStyle -> Opacity[0.5], Mesh -> False] intl = ParametricPlot3D[{{Sqrt[3 + t^2], t, Sqrt[1 - t^2]}, {Sqrt[3 + t^2], t, -Sqrt[1 - t^2]}, {-Sqrt[3 + t^2], t, Sqrt[1 - t^2]}, {-Sqrt[3 + t^2], t, -Sqrt[1 - t^2]}}, {t, -3, 3}, PlotPoints -> 100, PlotStyle -> Red] /. Line[pts_, rest___] :> Tube[pts, 0.05, rest]求出它们的相贯线:
Show[surfaces, intl]合并到一起看的效果:
因为所用参数的问题,空间曲线有两条,表达它们的式子则是四个。可以考虑合并下:
ParametricPlot3D[{{Sqrt[3+(Sin@t)^2],Sin@t,Cos@t},{-Sqrt[3+(Sin@t)^2], Sin@t, Cos@t}}, {t, 0, 2 Pi},PlotPoints ->100,PlotStyle ->Red,PlotRange->{{-2.5, 2.5}, {-1.2, 1.2}, {-1.2, 1.2}},AspectRatio -> Full] /. Line[pts_, rest___] :> Tube[pts, 0.025, rest]
参考文献: http://blog.csdn.net/stereohomology/article/details/45111345