Spherical Coordinates

Author

Eric W. Weisstein
October 26, 2005

This notebook downloaded from http://mathworld.wolfram.com/notebooks/CoordinateGeometry/SphericalCoordinates.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SphericalCoordinates.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

coords=r{Cos[θ]Sin[ϕ],Sin[θ]Sin[ϕ],Cos[ϕ]};
vars={r,θ,ϕ};
ranges=0≤θ<2π&&0≤ϕ<π&&r≥0;

VectorAnalysis Convention

<<Calculus`VectorAnalysis`

SetCoordinates[Spherical]

Spherical::usage

In the spherical coordinate system Spherical[r, theta, phi], the coordinate r gives the distance of the point from the origin, the coordinate θ gives the angle measured from the positive z axis, and the coordinate ϕ gives the angle measured in the x-y plane from the positive x axis, counterclockwise as viewed from the positive z axis.

{r,θ,ϕ} in terms of {x,y,z}

Solve[Thread[{x,y,z}==coords],vars]//Simplify

Scale Factors

FullSimplify[ScaleFactors[coords,vars],ranges]

Unit Vectors

MatrixForm/@(unitvecs=FullSimplify[UnitVectors[coords,vars],ranges])//TraditionalForm

xform=Join[
Thread[unitvecs->ToExpression/@(#<>"hat"&/@(ToString/@vars))],
Thread[-unitvecs->-ToExpression/@(#<>"hat"&/@(ToString/@vars))],
{{0,0,0}->zero},
Thread[unitvecs/r->1/r ToExpression/@(#<>"hat"&/@(ToString/@vars))],
Thread[-unitvecs/r->-1/r ToExpression/@(#<>"hat"&/@(ToString/@vars))],
{{-Cos[θ],-Sin[θ],0}->-Cos[ϕ]ϕhat-Sin[ϕ]rhat}
]

unitvecs/.xform

Derivatives of Unit Vectors

(dunitvecs=Outer[D,unitvecs,vars,1])//MatrixForm//TraditionalForm

Subtract@@{{-Cos[θ],-Sin[θ],0},-Cos[ϕ]unitvecs[[3]]-Sin[ϕ]unitvecs[[1]]}//Simplify

Transpose[(dunitvecs/.xform)/.x_List?VectorQ:>PolynomialGCD@@x(Cancel[(x/(PolynomialGCD@@x))]/.xform)]//MatrixForm

Gradients

MatrixForm@(grads=FullSimplify[Gradients[coords,vars],ranges&&ϕ>0])

unitvecs

MatrixForm[Simplify[(grads/.xform)/.x_List?VectorQ:>PolynomialGCD@@x(Cancel[(x/(PolynomialGCD@@x))]/.xform)]]

Christoffel Symbols

Misner et al.

MatrixForm/@FullSimplify[ChristoffelSymbols[coords,vars],ranges]

Arfken

MatrixForm/@FullSimplify[ChristoffelSymbols2[coords,vars],ranges]

Cross Products

Subsets[unitvecs,{2}]/.xform

Simplify[Cross@@@Subsets[unitvecs,{2}],ranges]/.xform

Jacobian

Simplify[JacobianDet[coords,vars],ranges]

Gradient

FullSimplify[Grad[coords,vars][f[Sequence@@vars]],ranges]

Laplacian

FullSimplify[Laplacian[coords,vars][f[Sequence@@vars]],ranges]

Properties

<<Calculus`VectorAnalysis`
coord=Spherical;

?Spherical

ScaleFactors[coord]

CoordinatesToCartesian[Coordinates[coord],coord]

CoordinatesFromCartesian[{x,y,z},coord]

Div[Through[{F1,F2,F3}@@Coordinates[coord]],coord]//TraditionalForm

Curl[Through[{F1,F2,F3}@@Coordinates[coord]],coord]//TraditionalForm

Grad[f@@Coordinates[coord],coord]//TraditionalForm

Laplacian[f@@Coordinates[coord],coord]//TraditionalForm