Zernike Polynomial

Author

Eric W. Weisstein
January 10, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/ZernikePolynomial.nb.

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

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

Notation

ZernikeR[m,n,ρ]//TraditionalForm

Definition

Built-In

Table[Zernike[n,m,r]-ZernikeR[n,m,r],{n,0,4},{m,0,n}]//Simplify

FunctionExpand[ZernikeR[n,m,r]]

(Subscript[R, n]^m)(r)==PIecewise((({{(i^(n-m)) (r^m) (Subscript[P, ((n-m)/2)]^((m,0)))(1-2 (r^2)), (Mod[(n-m), 2])==0}})),0)

Zernike[n_,m_,r_]:=If[OddQ[n-m],0,(-1)^((n-m)/2)JacobiP[(n-m)/2,m,0,1-2r^2]r^m]

FullSimplify[(-1)^((n-m)/2)JacobiP[(n-m)/2,m,0,1-2r^2]r^m,Mod[m-n,2]==0&&0≤m<n]

FunctionExpand[(-1)^((n-m)/2)JacobiP[(n-m)/2,m,0,1-2r^2]r^m,Mod[m-n,2]==0&&0≤m<n]

Table[Zernike[n,m,r]-ZernikeR[n,m,r],{n,0,4},{m,0,n}]//Simplify

(∑_(l=0)^((n-m)/2))(((((-1))^l) (n-l)! (r^(n-2 l)))/(l! (((m+n)/2)-l)! (((n-m)/2)-l)!))==(Subscript[R, n]^m)(r)

V6

Sum[(-1)^l(n-l)!/l!/((n+m)/2-l)!/((n-m)/2-l)! r^(n-2l),{l,0,(n-m)/2}]

V7

Sum[(-1)^l(n-l)!/l!/((n+m)/2-l)!/((n-m)/2-l)! r^(n-2l),{l,0,(n-m)/2}]

Sum[(-1)^l(n-l)!/l!/((n+m)/2-l)!/((n-m)/2-l)! r^(n-2l),{l,0,(n-m)/2},Assumptions->Mod[n-m,2]==0]

Table[If[Mod[n-m,2]==0,(((r^n) n! Hypergeometric2F1[(m/2)-(n/2),-(m/2)-(n/2),-n,(1/(r^2))])/(((1/2) (-m+n))! ((m+n)/2)!)),0]-ZernikeR[n,m,r],{n,0,4},{m,0,n}]

Zernike2[n_,m_,r_]:=If[OddQ[n-m],0,If[m==n,r^n,(((r^n) Gamma[1+n] Hypergeometric2F1[(1/2) (-m-n),((m-n)/2),-n,(1/(r^2))])/(Gamma[(1/2) (2-m+n)] Gamma[(1/2) (2+m+n)]))]]

Limit[(((r^n) Gamma[1+n] Hypergeometric2F1[(1/2) (-m-n),((m-n)/2),-n,(1/(r^2))])/(Gamma[(1/2) (2-m+n)] Gamma[(1/2) (2+m+n)])),m->n]

(∑_(s=0)^∞)(z^s) (Subscript[R, m+2 s]^m)(r)==((((-(Sqrt[2 (1-2 (r^2)) z+(z^2)+1])+z+1))^m)/((Sqrt[2 (1-2 (r^2)) z+(z^2)+1]) (((2 r z))^m)))

Sum[(z^s)ZernikeR[m+2s,m,r],{s,0,∞}]//Timing

Subtract@@@Table[{((((1+z-(Sqrt[1+2z(1-2(r^2))+(z^2)])))^m)/((((2z r))^m)(Sqrt[1+2z(1-2(r^2))+(z^2)]))),Sum[(z^s)ZernikeR[m+2s,m,r],{s,0,700}]}/.{m->RandomInteger[{0,10}],z->RandomReal[],r->RandomReal[]},{25}]//Chop//Union

SeriesCoefficient[((((1+z-(Sqrt[1+2z(1-2(r^2))+(z^2)])))^m)/((((2z r))^m)(Sqrt[1+2z(1-2(r^2))+(z^2)]))),{z,0,s}]

GeneratingFunction[ZernikeR[m+2s,m,r],s,z]

Tabulation

Table[Zernike[n,m,ρ],{n,0,4},{m,0,n}]//Expand//ColumnForm//TraditionalForm

Normalization

Table[Zernike[n,m,1],{n,0,4},{m,0,n}]

Orthogonality

Integrate[ZernikeR[n,m,ρ]Zernike[np,m,ρ] ρ,{ρ,0,1}]

Subtract@@@Flatten[Table[{Integrate[ZernikeR[n,m,ρ]ZernikeR[np,m,ρ] ρ,{ρ,0,1}],(1/(2(n+1)))KroneckerDelta[n,np]ZernikeR[n,m,1]},{m,0,5},{n,0,5},{np,0,5}],2]//Union

FullSimplify[ZernikeR[n,m,1]//FunctionExpand,(m|n)∈Integers]

Plots

Z[n_,m_,{r_,ϕ_}]:=If[m<=0,
{r Cos[ϕ],r Sin[ϕ],Zernike[n,m,r]Cos[m ϕ],EdgeForm[]},
{r Cos[ϕ],r Sin[ϕ],Zernike[n,m,r]Sin[m ϕ],EdgeForm[]}
]

Plot[Zernike[3,3,r],{r,0,4}]

((Subscript[Z, 3])^2)

ParametricPlot3D[Z[6,0,{r,ϕ}],{r,0,1},{ϕ,0,2π},PlotPoints->{30,70},PlotLabel->TraditionalForm[Superscript[Subscript[Z,n],m][r,ϕ]],
PlotRange->All,Axes->False,Boxed->False,ViewPoint->{1,1,2}]

ParametricPlot3D[{r Cos[ϕ],r Sin[ϕ],Zernike[3,3,r]Sin[3ϕ],EdgeForm[]},{r,0,1},{ϕ,0,2π},PlotPoints->{10,50},PlotLabel->TraditionalForm["((Subscript[Z, 3])^3)(r,ϕ)"],
PlotRange->All,Axes->False,Boxed->False]

?ParametricPlot