〓 Mathematica 3 〓
■ このスレッドは過去ログ倉庫に格納されています
0358132人目の素数さん
2006/10/17(火) 09:57:50こんな感じで関数を定義してみたらどう?
<< Graphics`PlotField`
PlotPolarVectorField[{f_, g_}, {r_,rmin_,rmax_}, {theta_, thetamin_, thetamax_}, options__] :=
Module[{h}, h[x_, y_] :=
If[rmin <= Norm[{x, y}] <= rmax && thetamin <= Arg[x + y I] <= thetamax, 1, 0];
PlotVectorField[h[x, y](f{Cos[g], Sin[g]} /.
{r -> Norm[{x, y}], theta -> Arg[x + y I] }),
{x, -rmax, rmax}, {y, -rmax, rmax}, options]]
PlotPolarVectorField[{r, r+theta}, {r, 2, 5}, {theta, -Pi, Pi}, PlotPoints->20]
↑ 極座標で表された各点(r,θ)において,長さr,偏角r+θのベクトルが
生えているようなベクトル場を,円環状領域 2≦r≦5, -π≦θ≦π において
表示するという例。
オプションには PlotVecotrField と同じオプション(ScaleFactor,ScaleFunction, MaxArrowLength, ColorFunction, PlotPoints)
が指定できます。
■ このスレッドは過去ログ倉庫に格納されています