A divergenceless field can be partitioned into a toroidal and a poloidal part. This separation is important in geo- and heliophysics, and in particular in dynamo theory and helioseismology. The toroidal field is defined as T = - 1/(sin θ) d/(dϕ) u(θ, ϕ)θ^^ + d/(dθ) u(θ, ϕ)ϕ^^, which can additionally be multiplied by a radial weighting function w(r). This is equivalent to the definition T = - w(r)·r^^x del _horizontal u(θ, ϕ), where u is a scalar function and the gradient is taken in spherical coordinates.