Spherical basis vectors are a local set of
basis vectors which point along the radial and angular directions
at any point in space.

The spherical basis is a set of three mutually orthogonal unit
vectors $$({\widehat{e}}_{az},{\widehat{e}}_{el},{\widehat{e}}_{R})$$ defined
at a point on the sphere. The first unit vector points along lines
of azimuth at constant radius and elevation. The second points along
the lines of elevation at constant azimuth and radius. Both are tangent
to the surface of the sphere. The third unit vector points radially
outward.

The orientation of the basis changes from point to point on
the sphere but is independent of *R* so as you move
out along the radius, the basis orientation stays the same. The following
figure illustrates the orientation of the spherical basis vectors
as a function of azimuth and elevation:

For any point on the sphere specified by *az* and *el*,
the basis vectors are given by:

Any vector can be written in terms of components in this basis
as $$v={v}_{az}{\widehat{e}}_{az}+{v}_{el}{\widehat{e}}_{el}+{v}_{R}{\widehat{e}}_{R}$$.
The transformations between spherical basis components and Cartesian
components take the form

.

and

$$\left[\begin{array}{c}{v}_{az}\\ {v}_{el}\\ {v}_{R}\end{array}\right]=\left[\begin{array}{ccc}-\mathrm{sin}(az)& \mathrm{cos}(az)& 0\\ -\mathrm{sin}(el)\mathrm{cos}(az)& -\mathrm{sin}(el)\mathrm{sin}(az)& \mathrm{cos}(el)\\ \mathrm{cos}(el)\mathrm{cos}(az)& \mathrm{cos}(el)\mathrm{sin}(az)& \mathrm{sin}(el)\end{array}\right]\left[\begin{array}{c}{v}_{x}\\ {v}_{y}\\ {v}_{z}\end{array}\right]$$.