您的位置首页生活百科

Mathematica绘制函数图像—三维“极坐标”

Mathematica绘制函数图像—三维“极坐标”

的有关信息介绍如下:

Mathematica绘制函数图像—三维“极坐标”

Mathematica里面,一般的绘制函数图像的命令,都有相应的三维模式。如:Plot和Plot3D,ParametricPlot和ParametricPlot3D,ContourPlot和ContourPlot3D。但是,PolarPlot的三维模式是什么?也就是,平面极坐标的三维模式是什么?答案是:球坐标。

球坐标的绘图,用SphericalPlot3D。

举个例子:

SphericalPlot3D[ 1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}]

画三个同心半球:

SphericalPlot3D[{1, 2, 3}, {\[Theta], 0, Pi}, {\[Phi], 0, Pi}, PlotPoints -> 30]

再举一例,这次涉及到复变函数:

SphericalPlot3D[

Re[Sin[\[Theta]] Cos[\[Theta]] Exp[2 I*\[CurlyPhi]]], {\[Theta],

0, \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]}]

绘图时,去掉坐标轴:

SphericalPlot3D[ 1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, Axes -> False]

绘图时,去掉外框:

SphericalPlot3D[{1, 2, 3}, {\[Theta], 0, Pi}, {\[Phi], 0, Pi},

PlotPoints -> 30, Boxed -> False]

绘图时,去掉网格线:

SphericalPlot3D[

Re[Sin[\[Theta]] Cos[\[Theta]] Exp[2 I*\[CurlyPhi]]], {\[Theta],

0, \[Pi]}, {\[CurlyPhi], 0, 2 \[Pi]}, Mesh -> None]

红色,不透明,高光:

SphericalPlot3D[

1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi},

PlotStyle -> Directive[Red, Opacity, Specularity[White, 10]],

Mesh -> None, PlotPoints -> 30, Axes -> False, Boxed -> False]

蓝色,半透明,高光:

SphericalPlot3D[

1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi},

PlotStyle -> Directive[Blue, Opacity[0.7], Specularity[White, 6]],

Mesh -> None, PlotPoints -> 30, Axes -> False, Boxed -> False]

绿色的半透明“仙人掌”:

SphericalPlot3D[

Re[Sin[\[Theta]] Cos[\[Theta]] Exp[2 I*\[CurlyPhi]]], {\[Theta], 0,

Pi}, {\[CurlyPhi], 0, 2 Pi},

PlotStyle -> Directive[Green, Opacity[0.5], Specularity[White, 6]],

Mesh -> None, PlotPoints -> 30, Axes -> False, Boxed -> False]

五个楞的“什么瓜”:

SphericalPlot3D[

1 + Sin[5 \[Phi]]/5, {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi},

PlotStyle -> Directive[Green, Opacity[0.5], Specularity[White, 10]],

Mesh -> None, PlotPoints -> 30, Axes -> False, Boxed -> False]

色彩渐变:

SphericalPlot3D[

Re[Sin[\[Theta]] Cos[\[Theta]] Exp[2 I*\[CurlyPhi]]], {\[Theta], 0,

Pi}, {\[CurlyPhi], 0, 2 Pi},

ColorFunction -> (ColorData["Rainbow"][#6] &), Mesh -> None,

PlotPoints -> 25, Boxed -> False, Axes -> False]

SphericalPlot3D[

1 + Sin[5 \[Phi]]/5, {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi},

ColorFunction -> (ColorData["Rainbow"][#6] &), Mesh -> None,

PlotPoints -> 25, Boxed -> False, Axes -> False]