绘图,平面,点,线,球在同一个3D图中。 Mathematica中同一图中的多个数字

时间:2011-09-15 18:54:19

标签: wolfram-mathematica

如何绘制相同3D图中的平面和直线?

3 个答案:

答案 0 :(得分:8)

ShowPlot3D可以处理它。可能还有很多其他方法。

l = Line[{{-2, -2, 41}, {6, 4, -10}}];

Show[{Plot3D[{2 x + 7 y}, {x, -2, 5}, {y, -2, 5},  AxesLabel -> {x, y, z}], 
      Graphics3D[{Thick, l}]}]

Plot3D

答案 1 :(得分:8)

炫耀: enter image description here

Manipulate[

 Show[
  {Plot3D[ {1}, {x, -1, 1}, {y, -1, 1}, PlotRange -> {-1, 1}, Mesh -> False],
   Plot3D[{-1}, {x, -1, 1}, {y, -1, 1},                       Mesh -> False],
   ParametricPlot3D[{{Sin@t, Cos@t, 1}, {Sin@t, Cos@t, -1}}, {t, 0, 2 Pi}],
   Graphics3D[
    {Table[{Hue[n/10], Thick, Line[{{Re[#], Im[#], 1}, {-z Re[#], -z Im[#], z}}&@
         Exp[n 2 I Pi/10]]}, {n, 10}],
     Sphere[{0, 0, 0}, .3]}]}],
    {z, 1, -1}]

答案 2 :(得分:7)

我无法抗拒......

enter image description here

GraphicsGrid[
 {
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0}, Axes -> None, ColorFunction -> (White &), 
    Lighting -> "Neutral"], 
   Style["One plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0, 5}, Axes -> None, ColorFunction -> (Green &), 
    Lighting -> "Neutral"], 
   Style["Two plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
    Contours -> {0}, Axes -> None, ColorFunction -> (Red &), 
    Lighting -> "Neutral"], 
   Style["Red plane", FontFamily -> "Comic Sans MS", 36, Bold]},
  {Show[
    ContourPlot3D[x + 2 y + 3 z , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
     Contours -> {0}, Axes -> None, ColorFunction -> (Blue &), 
     Lighting -> "Neutral"],
    Graphics3D[{Orange, Thickness[0.01], 
      Line[{{-2, -2, -2}, {2, 2, 2}}]}]
    ], Style["Blue plane", FontFamily -> "Comic Sans MS", 36, Bold]}
  }
 ]