* Mathematica* has built-in commands for plotting 2-and 3-dimensional vector fields. To use them, first call up the Graphics package PlotField or Plotfield3D. The following routine illustrates that process. Execute it to produce a plot of the two-dimensional vector field **F** with formula **F(***x, y***)** = *P(x, y)* **i** + *Q(x, y) ***j** for *P*(*x*, *y*) = - *y*/2 and *Q*(*x*, *y*) = *x*/2. (As usual, you execute the routine by placing your cursor after the last line and pressing Enter or Shift-Return.)

In[1]:=

Needs["Graphics`PlotField`"]

PlotVectorField[ {-y/2, x/2}, {x, -5, 5}, {y, -5, 5}, Axes -> True,

ColorFunction -> Hue, AxesLabel -> {x, y} ]

Out[2]=

$\u2043\mathrm{Graphics}\u2043$

The next routine illustrates use of the Plotfield3D package for the three-dimensional vector field **F** with formula **F**(*x*, *y*, *z*) = *y ***i** + *z* **j** + *x*** k**. Try it!

In[3]:=

Needs["Graphics`PlotField3D`"]

PlotVectorField3D[{y, z, x}, {x, -2, 2}, {y, -2, 2},

{z, -2, 2}, Axes -> True, ColorFunction -> Hue,

PlotPoints -> 5, AxesLabel -> {x, y, z},

VectorHeads -> True]

Out[4]=

$\u2043\mathrm{Graphics3D}\u2043$

* Mathematica* also has a built-in command to plot the

In[5]:=

Needs["Graphics`PlotField3D`"]

PlotGradientField3D[ Sqrt[x^2 + y^2 + z^2],{x, -2, 2}, {y, -2, 2},

{z, -2, 2}, Axes -> True, ColorFunction->Hue,

PlotPoints -> 5, AxesLabel -> {x, y, z},

VectorHeads -> True]

Out[6]=

$\u2043\mathrm{Graphics3D}\u2043$

Converted by *Mathematica*
(June 19, 2003)