Skip to content
ihateDesmos

Vector field plotter

Type a vector field as a pair (P, Q) of expressions in x and y, and the calculator draws an arrow at each grid point. The Analysis tab adds divergence, curl, line integrals and flux, computed symbolically where possible.

−4−224−220
Open in calculator
The field
F=(y, −x+0.3y)
: arrows spiral outward because the field has positive divergence 0.3 everywhere.

How to use the vector field plotter

  1. 1
    Type the field as a pair: (-y, x). Both components can use x and y.
  2. 2
    Arrows are scaled to stay readable at any zoom; change their colour in the row’s settings.
  3. 3
    Select the field and open Analysis for its divergence and curl, and to compute work and flux along any curve you add.
  4. 4
    For 3D fields, switch to 3D and give three components: (-y, x, z/4).

Divergence and curl

For a 2D field F = (P, Q):

  • Divergence ∂P/∂x + ∂Q/∂y measures how much the field spreads out from a point. Sources have positive divergence, sinks negative.
  • Curl ∂Q/∂x − ∂P/∂y measures how much it rotates around a point.

The rotation field (−y, x) has divergence 0 and curl 2 everywhere; the source field (x, y) has divergence 2 and curl 0. The Analysis tab computes both symbolically and can graph them as surfaces.

Conservative fields

A field is conservative, the gradient of some potential function, when its curl is zero on a simply connected region. Then the line integral between two points does not depend on the path taken. The calculator flags a field as conservative when its curl simplifies to zero, which is the test you would use by hand.

Line integrals and flux

Add a parametric curve such as (2cos(t), 2sin(t)) and select the field. The Analysis tab reports the work ∫ F · dr along the curve and the flux ∫ F · n ds across it, each computed by adaptive Gauss–Kronrod quadrature with an error estimate. For a closed curve these are the two sides of Green’s theorem.

Examples to try

−4−224−220
Rotation
(-y, x)
Divergence 0, curl 2: pure rotation.
Open this example
−4−224−220
Saddle
(x, -y)
Flows in along y and out along x. It is the gradient of (x² − y²)/2.
Open this example
−4−224−220
A field with a sink
(-x - y, x - y)
Divergence −2: everything spirals into the origin.
Open this example

Frequently asked questions

How do I plot a vector field?
Type its components as a pair, such as (-y, x). For 3D, give three components and switch to 3D.
How do I find the divergence and curl?
Select the field and open the Analysis tab. Both are computed symbolically and can be added to the graph.
How do I know if a vector field is conservative?
Check whether its curl is zero. The Analysis tab says so when the curl simplifies to zero.
Can it compute line integrals?
Yes. Add a parametric curve, select the field, and the Analysis tab gives the work and flux along it with an error estimate.

Related tools and guides

Try the vector field plotter

It opens instantly, with no account and nothing to install.

Open the calculator