Vector Field Visualizer

Use this Vector Field Visualizer to enter values, adjust options, and review results in a compact responsive workspace.

Vector Field Visualizer

Results are calculated automatically as you enter data.

Ready.

Field analysis

Sample values

▼ See explanations and tips below ▼

What Is Vector Field Visualization?

A vector field assigns a vector to every point in a region. In two dimensions, a vector field can be written as

$$ \mathbf{F}(x,y)=\langle P(x,y), Q(x,y)\rangle $$

where \(P\) is the horizontal component and \(Q\) is the vertical component. In three dimensions, a vector field can be written as

$$ \mathbf{F}(x,y,z)=\langle P(x,y,z), Q(x,y,z), R(x,y,z)\rangle $$

where \(R\) is the z-direction component.

A visualization turns those component formulas into a map of arrows. Each arrow starts at a sampled point, points in the direction of the vector there, and represents the local strength of the field through its magnitude. This makes it easier to see patterns that are hard to understand from formulas alone, such as flow away from a source, flow into a sink, circular motion, spirals, saddle-like behavior, and places where the vector becomes very small.

Vector fields appear throughout mathematics, physics, and engineering. They can describe wind velocity, fluid flow, gravitational force, electric and magnetic fields, heat flow, and phase-plane behavior in differential equations. Even when a field is purely mathematical, drawing it helps you connect formulas with geometric behavior.


Why Vector Field Visualization Matters

A component formula tells you what the field is at any point, but a graph helps you understand how the field behaves across a whole region. This is especially useful when learning multivariable calculus or vector calculus because many important ideas are local and visual:

  • Direction: Which way does the field point at each location?
  • Magnitude: Where is the field strong or weak?
  • Divergence: Does the field locally spread outward, pull inward, or preserve area?
  • Curl: Does the field locally rotate, and in what sense?
  • Critical points: Where does the vector become zero or nearly zero?
  • Streamlines: What paths would particles follow if they moved with the field direction?

Visualization does not replace algebra, but it helps you decide what the algebra is saying. A graph can also reveal whether a formula was entered incorrectly, whether the chosen plotting window hides important behavior, or whether a field has singularities or rapid changes that need closer inspection.


Key Terms to Know

  • Vector field: A function that assigns a vector to each point in a region.
  • Component: One coordinate part of the vector field, such as \(P\), \(Q\), or \(R\).
  • Magnitude: The length or strength of a vector.
  • Divergence: A scalar quantity that describes local spreading outward or pulling inward.
  • Curl: A quantity that describes local rotational tendency.
  • Streamline: A curve whose tangent direction follows the vector field.
  • Critical point: A point where the vector field is zero, or close enough to zero to be treated as a candidate for special behavior.
  • Partial derivative: A derivative with respect to one variable while the other variables are held fixed.
  • Finite difference: A numerical way to approximate a derivative using nearby function values.
  • Slice: A lower-dimensional view of a higher-dimensional field, such as an xy plane at a fixed z value.

How Vector Field Visualization Works

A vector field visualizer samples points inside the selected plotting window and evaluates the component formulas at each point. For a 2D field,

$$ \mathbf{F}(x,y)=\langle P(x,y), Q(x,y)\rangle $$

the magnitude is

$$ |\mathbf{F}|=\sqrt{P^2+Q^2} $$

For a 3D field,

$$ \mathbf{F}(x,y,z)=\langle P(x,y,z), Q(x,y,z), R(x,y,z)\rangle $$

the full magnitude is

$$ |\mathbf{F}|=\sqrt{P^2+Q^2+R^2} $$

When a 3D field is viewed as an xy slice, the displayed arrows are based on the x- and y-direction behavior on that slice. A dot marks a positive \(R\) component (toward the viewer) and a cross marks a negative \(R\) component (away from the viewer); glyph size is comparative. The selected z value is held fixed, so the graph shows how the field behaves across the xy plane at that particular height. The z-component also contributes to the reported 3D magnitude, divergence, and curl, but the slice is not a full 3D volume plot.

Divergence

Divergence measures local source-like or sink-like behavior. In two dimensions,

$$ \operatorname{div}\mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} $$

In three dimensions,

$$ \operatorname{div}\mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z} $$

A positive divergence suggests local outward spreading. A negative divergence suggests local inward flow. A divergence near zero suggests that, locally, the field is not expanding or compressing in the divergence sense. This interpretation is easiest to picture for fluid velocity fields, but the same calculation is used for general vector fields.

Curl

Curl measures local rotational tendency. In a two-dimensional vector field, the most relevant curl value is the scalar z-component:

$$ \operatorname{curl}_{2D}\mathbf{F} = \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} $$

A positive value usually corresponds to counterclockwise local rotation in the xy plane, while a negative value corresponds to clockwise local rotation. A value near zero means little or no local spin in that scalar curl sense.

For a three-dimensional field, curl is a vector:

$$ \nabla \times \mathbf{F} = \left\langle \frac{\partial R}{\partial y}-\frac{\partial Q}{\partial z}, \frac{\partial P}{\partial z}-\frac{\partial R}{\partial x}, \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y} \right\rangle $$

The direction of the curl vector gives the axis of local rotation, and its magnitude gives the strength of that rotational tendency.

Numerical Derivatives

Divergence and curl require derivatives. This calculator uses adaptive five-point finite differences for smooth interior points. For a function \(f\) and variable \(u\), with all other variables held fixed, the main estimate is

$$ \frac{\partial f}{\partial u} \approx \frac{f(u-2h)-8f(u-h)+8f(u+h)-f(u+2h)}{12h} $$

The step is chosen from the plotted span and coordinate scale, then reduced while successive estimates are checked for agreement. Forward and backward slopes are also compared as a local smoothness check. The calculator also checks whether the nearby function values have sufficient floating-point resolution: a large constant offset can otherwise make a small local change look like a reliable zero derivative. If nearby values are outside the function domain, lack sufficient resolution, or the estimates do not stabilize, the calculator reports the derivative as unreliable instead of displaying a misleading number. This remains numerical rather than symbolic calculus, so analytic validation is appropriate for consequential work.

Streamlines

A streamline follows the direction of the field. In a two-dimensional plot, a streamline is a curve that moves in the direction of the xy vector

$$ \langle P(x,y), Q(x,y)\rangle $$

The displayed curve is integrated in both directions with an adaptive fourth-order Runge–Kutta method. Direction is normalized so the curve shows streamline geometry without jumping across high-magnitude regions. It stops at domain boundaries, undefined points, or true zero vectors. In 3D slice mode these are projected xy streamlines at fixed \(z\), not spatial trajectories.


Examples of Vector Fields in Practice

Example 1: A Source Field

Consider the field

$$ \mathbf{F}(x,y)=\langle x,y\rangle $$

At each point, the vector points away from the origin. The magnitude is

$$ |\mathbf{F}|=\sqrt{x^2+y^2} $$

so vectors farther from the origin are stronger. The divergence is

$$ \operatorname{div}\mathbf{F} = \frac{\partial x}{\partial x} + \frac{\partial y}{\partial y} = 1+1 = 2 $$

The scalar curl is

$$ \operatorname{curl}_{2D}\mathbf{F} = \frac{\partial y}{\partial x} - \frac{\partial x}{\partial y} = 0-0 = 0 $$

This field has outward spreading but no local rotation. The origin is a critical point because

$$ \mathbf{F}(0,0)=\langle 0,0\rangle $$

Example 2: A Rotational Field

Consider the field

$$ \mathbf{F}(x,y)=\langle y,-x\rangle $$

At the point \((1,0)\), the vector is \(\langle 0,-1\rangle\), so it points downward. At \((0,1)\), the vector is \(\langle 1,0\rangle\), so it points right. Together, these arrows form clockwise rotation around the origin.

The divergence is

$$ \operatorname{div}\mathbf{F} = \frac{\partial y}{\partial x} + \frac{\partial (-x)}{\partial y} = 0+0 = 0 $$

The scalar curl is

$$ \operatorname{curl}_{2D}\mathbf{F} = \frac{\partial (-x)}{\partial x} - \frac{\partial y}{\partial y} = -1-1 = -2 $$

This field has rotational behavior but no divergence. It is a good example of why divergence and curl describe different features.


Example 3: A Spiral Field

Consider the field

$$ \mathbf{F}(x,y)=\langle x-y, x+y\rangle $$

The \(\langle x,y\rangle\) part pushes outward from the origin, while the \(\langle -y,x\rangle\) part adds rotation. The result is a spiral-like pattern.

The divergence is

$$ \operatorname{div}\mathbf{F} = \frac{\partial (x-y)}{\partial x} + \frac{\partial (x+y)}{\partial y} = 1+1 = 2 $$

The scalar curl is

$$ \operatorname{curl}_{2D}\mathbf{F} = \frac{\partial (x+y)}{\partial x} - \frac{\partial (x-y)}{\partial y} = 1-(-1) = 2 $$

This field has both outward spreading and counterclockwise rotational tendency.


Example 4: A 3D Slice

Consider the 3D field

$$ \mathbf{F}(x,y,z)=\langle -y,x,z+x\rangle $$

At a fixed z value, the xy arrows come from \(\langle -y,x\rangle\), which rotate counterclockwise around the origin. The full field also has a z-component, \(z+x\), so the complete 3D vector includes vertical behavior that cannot be fully represented by a flat xy arrow plot.

For this field,

$$ \operatorname{div}\mathbf{F} = \frac{\partial (-y)}{\partial x} + \frac{\partial x}{\partial y} + \frac{\partial (z+x)}{\partial z} = 0+0+1 = 1 $$

The 3D curl is

$$ \nabla \times \mathbf{F} = \left\langle \frac{\partial (z+x)}{\partial y}-\frac{\partial x}{\partial z}, \frac{\partial (-y)}{\partial z}-\frac{\partial (z+x)}{\partial x}, \frac{\partial x}{\partial x}-\frac{\partial (-y)}{\partial y} \right\rangle $$

which simplifies to

$$ \nabla \times \mathbf{F} = \langle 0, -1, 2\rangle $$

The slice view helps you see the xy rotation, while the 3D curl vector and divergence report additional information about the field in space.


How to Interpret the Result

The graph and numeric outputs work together. The arrows give a visual overview, while divergence, curl, and sample-point values give local measurements.

Arrow direction shows the xy direction of the field at sampled points. In 2D, this is the direction of \(\langle P,Q\rangle\). In 3D slice mode, it is the direction of the xy part of the field at the selected z value.

Arrow length is comparative. Visualizers commonly scale arrows so the graph remains readable. A longer arrow generally means a larger sampled xy magnitude relative to other arrows in the same plot, but the drawn length should not be treated as a precise physical scale.

Magnitude describes the strength of the vector. In 2D, magnitude is based on \(P\) and \(Q\). In 3D, the full magnitude also includes \(R\).

Heat-map intensity compares local magnitude with the 95th percentile of valid sampled magnitudes. Values above that robust reference saturate, so one extreme outlier does not wash out the rest of the plot. Intensity is relative to the chosen window, not an absolute physical scale.

Divergence at the center describes local source-like or sink-like behavior at the midpoint of the plotted domain, or at that midpoint on the selected z slice in 3D mode.

Curl at the center describes local rotation. In 2D, it is a scalar value for rotation in the xy plane. In 3D, it is a vector, so each component matters.

Critical-point candidates in 2D begin at local minima of sampled magnitude and are refined with a damped numerical Newton step. In 3D slice mode they are near-zero candidates on the displayed slice. They remain numerical clues rather than exact solutions to \(P=0\), \(Q=0\), and, in 3D, \(R=0\).

The sample-point table helps compare field values, divergence, and curl at important locations such as the origin, the center, and visible domain corners. Use it to connect the graph with actual numeric values.


Common Mistakes and Misconceptions

Confusing a vector field with a single vector

A single vector has one direction and one magnitude. A vector field has a vector at every point in a region. The graph shows a sample of these vectors, not the entire infinite collection.

Reading scaled arrows as exact lengths

Arrow length is often scaled for readability. A vector field plot is mainly a direction-and-pattern diagram. Use numeric magnitude values when you need actual computed values.

Expecting degree-based trigonometry

Trigonometric expressions use radians. For example, \(\sin(\pi/2)=1\), while \(\sin(90)\) means 90 radians, not 90 degrees.

Treating 3D slice mode as a full 3D plot

A 3D slice at a fixed z value is not the same as a full volume visualization. It can analyze a 3D component formula on one xy plane, but it does not show every z level at once. Dots and crosses encode the sign of the depth component, while streamline and particle paths remain xy projections. In 3D mode, the plot's curl colors show the z-component of curl; the analysis cards and table report the full curl vector.

Treating critical-point hints as exact answers

Critical-point candidates begin with a finite scan grid and numerical refinement. They can still miss roots, repeated or non-isolated equilibria, points near singularities, or roots in rapidly changing regions. To find exact critical points, solve the component equations algebraically when possible.

Assuming numerical derivatives are symbolic derivatives

Numerical derivatives approximate local rates of change using nearby values. They are practical for visualization, but they can behave poorly when expressions are discontinuous, undefined, extremely steep, or affected by floating-point roundoff.

Forgetting that bounds matter

A plot only shows the selected region. A field may look simple in one window and reveal sources, sinks, spirals, or near-zero points in another. If the result seems surprising, adjust the x and y bounds and compare.


When to Use Vector Field Visualization

Use vector field visualization when you want to:

  • understand the shape and direction of a multivariable vector function;
  • compare source, sink, rotational, and spiral behavior;
  • study divergence and curl alongside a graph;
  • explore examples from vector calculus, physics, engineering, or differential equations;
  • inspect local behavior at the origin, center, or corners of a domain;
  • check whether a formula produces the qualitative pattern you expected;
  • create a visual aid for teaching, homework, notes, or presentations.

It is especially useful before doing more formal work such as solving for critical points, classifying equilibria, computing line integrals, or applying Green’s theorem, Stokes’ theorem, or the divergence theorem.


Limitations and Things to Keep in Mind

Vector field visualizations are powerful, but they are not exact mathematical proofs.

The plotted arrows come from a finite sampling grid. Increasing density can show more detail, but it cannot show every point in the domain. Very rapid changes, narrow features, and isolated critical points may still be missed.

The numeric derivatives are finite-difference approximations. They are usually most meaningful for smooth component formulas and less reliable near discontinuities, sharp corners, vertical asymptotes, undefined values, or when floating-point value resolution cannot distinguish a small local change from a large component offset. In that case, divergence and curl are withheld as unreliable.

In 3D mode, the visualization is an xy slice at one z value. It can report 3D divergence and curl at that slice and encode the sign of \(R\) with depth glyphs, but it does not render a full 3D field or show z-direction streamlines.

Animated particles use time-based fourth-order Runge–Kutta steps. Their velocities share one robust global scale, so relative xy speeds are preserved while the animation remains readable. They are qualitative projected trajectories, not a substitute for a unit-aware differential-equation solver.

The calculator uses arbitrary coordinate units. It does not perform physical unit conversion, and the meaning of units depends on the formulas you enter.

Displayed numbers are rounded for readability. Very small values may appear as zero, non-finite values may be shown as undefined, and outputs should be treated as numerical approximations.

Animation and streamlines are qualitative. Streamlines follow normalized xy direction to emphasize geometry; particles preserve relative xy speeds through a shared display scale. Neither should be interpreted as exact physical motion unless the field, units, and display scaling have been defined for that purpose.


How to Use This Calculator

  1. Choose 2D mode for a field of the form \(\mathbf{F}(x,y)=\langle P,Q\rangle\), or choose 3D mode for an xy slice of \(\mathbf{F}(x,y,z)=\langle P,Q,R\rangle\).
  2. Enter the \(P\) and \(Q\) component expressions. In 3D mode, also enter the \(R\) component and the z slice value.
  3. Set the x minimum, x maximum, y minimum, and y maximum. Each maximum must be greater than its matching minimum.
  4. Adjust density to control the number of sampled arrows. Density is rounded and kept within the supported range.
  5. Adjust animation speed if animation is enabled.
  6. Turn streamlines, heat map, curl coloring, or animation on or off depending on what you want to study.
  7. Try a preset such as rotation, source, sink, spiral, or helical if you want a quick example.
  8. Review the center divergence, center curl, displayed slice, critical-point hints, and sample-point table.
  9. Move the pointer over the graph to inspect local magnitude, divergence, and curl values.
  10. Download the graph as a PNG if you need to save the current visualization.

Supported expression features include variables such as \(x\), \(y\), and \(z\), constants such as \(\pi\) and \(e\), common operators, and standard functions such as \(\sin\), \(\cos\), \(\tan\), \(\sqrt{\ }\), \(\exp\), \(\ln\), and \(\log\). Function calls should use parentheses, such as \(\sin(x)\).


Frequently Asked Questions

What does a vector field visualizer show?

It shows a sampled picture of a vector field over a chosen region. Each arrow represents the vector direction and relative strength at a sampled point, while optional overlays can show streamlines, magnitude intensity, curl coloring, and animated particle motion.


What is the difference between divergence and curl?

Divergence measures local outward or inward tendency. Curl measures local rotational tendency. A field can have divergence without curl, curl without divergence, both, or neither.


Why do the arrows not match the exact vector lengths?

Vector field plots often scale arrow lengths so the graph stays readable. Without scaling, large vectors can cover the plot and small vectors can disappear. Use the numeric magnitude values when you need computed strength rather than visual comparison.


Does 3D mode show a full 3D vector field?

No. It shows an xy slice of a 3D field at the selected z value. This is useful for studying how a 3D field behaves on one plane, but it is not a full 3D volume rendering.


Are critical-point hints exact?

No. They are approximate candidates based on a scan of sampled points. For exact critical points, solve the equations where the field components equal zero, then use the visual hints to check whether the answers make sense in the plotted region.


Why might divergence or curl show as undefined?

Undefined results can happen when a component expression cannot be evaluated at the needed point or nearby finite-difference points. Common causes include division by zero, square roots of negative values in real-valued expressions, logarithms of nonpositive values, or expressions that produce non-finite values.


Can I use time-dependent fields?

You can write expressions that include a time-like variable only if the interface supports it as an input. In this calculator, there is no user-controlled time input, so time-dependent animation through a changing \(t\) value is not supported.


Sources and References

Books and Textbooks

  1. OpenStax. Calculus Volume 3. OpenStax, Rice University, 2016. Chapter 6, Sections 6.1 “Vector Fields” and 6.5 “Divergence and Curl.” https://openstax.org/books/calculus-volume-3/pages/6-1-vector-fields and https://openstax.org/books/calculus-volume-3/pages/6-5-divergence-and-curl
  2. Steve Schlicker, Mitchel T. Keller, and Nicholas Long, with contributing authors David Austin and Matt Boelkins. Active Calculus - Multivariable. Active Calculus, updated December 10, 2025. Chapter 12, Section 12.1 “Vector Fields.” https://activecalculus.org/multi/SVectorVectorFields.html
  3. Qingkai Kong, Timmy Siauw, and Alexandre Bayen. Python Programming and Numerical Methods: A Guide for Engineers and Scientists. 1st ed., Elsevier, 2020. Chapter 20, Section 20.2 “Using Finite Difference to Approximate Derivatives.” https://shop.elsevier.com/books/python-programming-and-numerical-methods/kong/978-0-12-819549-9 and https://pythonnumericalmethods.studentorg.berkeley.edu/notebooks/chapter20.02-Finite-Difference-Approximating-Derivatives.html

Online Educational Sources

  1. Paul Dawkins. “Curl and Divergence.” Paul’s Online Notes, last modified November 16, 2022. https://tutorial.math.lamar.edu/classes/calciii/curldivergence.aspx