Skip to content

curl

general · scripts/general/curl.m

: [cx, cy, cz, v] = curl (x, y, z, fx, fy, fz)
: [cz, v] = curl (x, y, fx, fy)
: […] = curl (fx, fy, fz)
: […] = curl (fx, fy)
: v = curl (…)

Curl of a sampled vector field.

The field is given by its components fx, fy and, in three dimensions, fz, each an array of samples on a grid. The grid coordinates may be supplied as x, y and z; without them the samples are taken to be one unit apart. Derivatives are formed with gradient.

In three dimensions the components of the curl are

cx = dFz/dy - dFy/dz
cy = dFx/dz - dFz/dx
cz = dFy/dx - dFx/dy

and v is the angular velocity of a small body carried by the flow: half the curl projected onto the direction of the field at each point. In two dimensions only cz, the out-of-plane component, exists and v is half of it. Requesting a single output returns v.