Vector Fields, Curl and Divergence
Text A vector field is defined by a function which associates a vector with each
point in the domain of the function.
In two dimensions, a vector field V can be expressed in terms of the functions p(x,y) and q(x,y) as V(x,y) = (p(x,y),q(x,y)).
Note that for the gradient vector field, p = f_{x} and q = f_{y}.
The divergence of a vector field V(x,y) = (p(x,y),q(x,y)) is defined as div V = ∇ ⋅ V = p_{x} + q_{y}.
Note that divergence of a vector field is a scalar value.
The scalar curl of a twodimensional vector field is defined as scalar curl V = p_{y}(x,y)+q_{x}(x,y).
The curl of a vector field V is usually defined for a vector field in three variables by the condition curl V = ∇ x V. If the third coordinate is 0, then curl(p(x,y),q(x,y),0) = ∇ {times} (p(x,y),q(x,y),0) = (0,0,q_{x}p_{y}). The third coordinate, p_{y}(x,y)+q_{x}(x,y) is called the scalar curl of V. The scalar curl of a vector field in the plane is a function of x and y and it is often useful to consider the function graph of the (x,y,p_{y}(x,y) + q_{x}(x,y)).
If a twodimensional vector field F(p,q) is conservative, then its curl is identically zero since p_{y} = q_{x}, ∇ {times} F = (0,0,q_{x}p_{y}) = (0,0,0).
Demos
Divergence and Curl in 2D
 
This demo shows, in the first window, the vector field V(x,y). In the "Divergence" window, the zcoordinate of the red surface indicates the value of the divergence at (x,y): div((x,y)) = f(x,y) = z. In the "Curl" window, the zcoordinate of the green surface indicates the value of the scalar curl at (x,y).

