NAME

LiveGraphicsVectorField2D.pl - provide an interactive plot of a 2D vector field.

DESCRIPTION

This macro provides a method for creating an interactive plot of a vector field via the LiveGraphics3D JavaScript applet. The method takes two MathObject Formulas of two variables as input and returns a string of plot data that can be displayed using the Live3Ddata routine of the LiveGraphics3D.pl macro.

METHODS

VectorField2D

Usage: VectorField2D(%options)

The available options are as follows.

Fx => Formula('y')

Function for the x-coordinate.

Fy => Formula('-x')

Function for the y-coordinate.

xvar => 'x'

First independent variable name, default 'x'. This must correspond to the first variable used in the Fx and Fy.

yvar => 'y'

Second independent variable name, default 'y'. This must correspond to the second variable used in the Fx and Fz.

xmin => -3

Lower bound for the domain of the first independent variable.

xmax => 3

Upper bound for the domain of the first independent variable.

ymin => -3

Lower bound for the domain of the second independent variable.

ymax => 3

Upper bound for the domain of the second independent variable.

xsamples => 20

The number of sample values for the first independent variable in the interval from xmin to xmax to use.

ysamples => 20

The number of sample values for the second independent variable in the interval from ymin to ymax to use.

axesframed => 1

If set to 1 then the framed axes are displayed. If set to 0, the the framed axes are not shown. This is 1 by default.

xaxislabel => 'x'

Label for the axis corresponding to the first independent variable.

yaxislabel => 'y'

Label for the axis corresponding to the second independent variable.

vectorcolor => 'RGBColor[0.0, 0.0, 1.0]'

Color of vectors shown in the slope field.

vectorscale => 0.2

Multiplier that determines the lentgh of vectors shown in the slope field.

vectorthickness => 0.001

Thickness (or width) of the line segments used to construct the vectors shown in the slope field.

outputtype => 1

This determines what is contained in the string that the method returns. The values of 1 through 4 are accepted, and have the following meaning.

  1. Return a string of only polygons (or edge mesh).

  2. Return a string of only plot options.

  3. Return a string of polygons (or edge mesh) and plot options.

  4. Return the complete plot to be passed directly to the Live3DData method.