ZernikeR[n,m,r]
gives the radial Zernike polynomial
.
ZernikeR
ZernikeR[n,m,r]
gives the radial Zernike polynomial
.
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- Explicit polynomials are given when possible.
- The Zernike polynomials are orthogonal with weight
over the unit interval. - ZernikeR can be evaluated to arbitrary numerical precision.
- ZernikeR automatically threads over lists.
- ZernikeR can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (4)
ZernikeR[3, 1, 0.5]ZernikeR[5, 3, r]Plot over a subset of the reals:
Plot[ZernikeR[1 / 5, 1, r], {r, 0, 1}]Plot over a subset of the complexes:
ComplexPlot3D[ZernikeR[1 / 5, 3, z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Scope (26)
Numerical Evaluation (6)
ZernikeR[2, 4, 1.7]ZernikeR[-7, 1, .6]N[ZernikeR[1 / 5, 2 / 3, 1 / 7], 100]The precision of the output tracks the precision of the input:
ZernikeR[5, 1, 4.2222222222222222222]N[ZernikeR[2 / 5, 2 - I, 2]]Evaluate efficiently at high precision:
ZernikeR[7 / 11, 1 / 7, 1 / 7`100]//TimingZernikeR[2, 5 / 3, 4 / 7`1000];//TimingZernikeR can be used with Interval and CenteredInterval objects:
ZernikeR[0.3, 0.4, Interval[{0.5, 0.6}]]ZernikeR[2I, 1, CenteredInterval[2, 1 / 100]]Compute the elementwise values of an array:
ZernikeR[5, 1, {{1 / 2, 0}, {0, 1 / 2}}]Or compute the matrix ZernikeR function using MatrixFunction:
MatrixFunction[ZernikeR[5, 1, #]&, {{1 / 2, 1}, {1, 1 / 2}}]//FullSimplifySpecific Values (3)
Values of ZernikeR at fixed points:
Table[ZernikeR[5, 1, x ], {x, 1, 5}]ZernikeR[0, 0, 0]Find the first positive minimum of ZernikeR[7,5,x ]:
xmin = x /. Solve[D[ZernikeR[7, 5, x ], x] == 0 && 0 < x < 5, x][[1]]Plot[ZernikeR[7, 5, x ], {x, -1, 1}, Epilog -> Style[Point[{xmin, ZernikeR[7, 5, xmin ]}], PointSize[Large], Red]]Visualization (3)
Plot the ZernikeR function for various orders:
Plot[{ZernikeR[1, 1, x], ZernikeR[3, 1, x], ZernikeR[5, 1, x], ZernikeR[7, 1, x]}, {x, -.7, .7}]ComplexContourPlot[Re[ZernikeR[5, 1, z]], {z, -5 - 5I, 5 + 5I}, Contours -> 24]ComplexContourPlot[Im[ZernikeR[5, 1, z]], {z, -5 - 5I, 5 + 5I}, Contours -> 24]Plot as real parts of two parameters vary:
Plot3D[Re[ZernikeR[n, 1, z]], {n, 0, 5}, {z, -1, 1}, PlotRange -> All]Function Properties (10)
Domain of ZernikeR of integer orders:
{FunctionDomain[ZernikeR[1, 2, z], z], FunctionDomain[ZernikeR[2, 4, z], z]}{FunctionDomain[ZernikeR[1, 2, z], z, Complexes], FunctionDomain[ZernikeR[2, 4, z], z, Complexes]}The range for ZernikeR of integer orders:
FunctionRange[ZernikeR[1, 2, x], x, y]FunctionRange[ZernikeR[1, 2, z], z, y, Complexes]ZernikeR has the mirror property
:
{ZernikeR[1, 2, Conjugate[z]] == Conjugate[ZernikeR[1, 2, z]], ZernikeR[2, 3, Conjugate[z]] == Conjugate[ZernikeR[2, 3, z]]}ZernikeR is an analytic function of x:
FunctionAnalytic[ZernikeR[3, 1, x], x]ZernikeR is neither non-decreasing nor non-increasing:
FunctionMonotonicity[ZernikeR[3, 1, x], x]ZernikeR is not injective:
FunctionInjective[ZernikeR[3, 1, x], x]Plot[{ZernikeR[3, 1, x], .5}, {x, -2, 2}]FunctionSurjective[ZernikeR[3, 1, x], x]Plot[{ZernikeR[3, 1, x], 20}, {x, -3, 3}]ZernikeR is neither non-negative nor non-positive:
FunctionSign[ZernikeR[3, 1, x], x]ZernikeR has no singularities or discontinuities:
FunctionSingularities[ZernikeR[3, 1, x], x]FunctionDiscontinuities[ZernikeR[3, 1, x], x]ZernikeR is neither convex nor concave:
FunctionConvexity[ZernikeR[3, 1, x], x]TraditionalForm formatting:
ZernikeR[n, m, r]//TraditionalFormDifferentiation (2)
First derivative with respect to r:
D[ZernikeR[n, m, r], r]Higher derivatives with respect to r:
Table[D[ZernikeR[n, m, r], {r, k}], {k, 1, 3}]//FullSimplifyPlot the absolute values of the higher derivatives with respect to r:
Plot[Evaluate [% /. {n -> 3, m -> 1}], {r, -1, 1}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Function Identities and Simplifications (2)
ZernikeR is defined in terms of the Jacobi polynomial:
ZernikeR[n, m, r] == r^m Cos[(1/2) (-m + n) π] JacobiP[(1/2) (-m + n), m, 0, 1 - 2 r^2]//FunctionExpandZernikeR may reduce to a simpler form:
ZernikeR[4, 2, r]ZernikeR[4, 0, r]Applications (1)
A function to convert a radial representation to a Cartesian one:
r2c[e_] := Simplify[TrigExpand[e] /. {Sin[θ] :> y / r, Cos[θ] :> x / r} /. r ^ n_ :> (x ^ 2 + y ^ 2) ^ (n / 2)]zPlot[e_] := With[{f = r2c[e]}, DensityPlot[Cos[2 Pi f] ^ 2, {x, -1, 1}, {y, -1, 1}, RegionFunction :> (#1 ^ 2 + #2 ^ 2 ≤ 1&), PlotPoints -> 50, BoundaryStyle -> Black, Frame -> False]]Visualize the combined effect of
-astigmatism and
-coma aberrations:
zPlot[ZernikeR[2, 2, r]Cos[2θ] + 2ZernikeR[3, 1, r]Sin[θ]]Properties & Relations (6)
Obtain a sequence of Zernike polynomials from their generating function:
m = 3;Series[r^m(((1 + t + Sqrt[1 + 2 (1 - 2 r^2) t + t^2]) / 2)^-m/Sqrt[1 + 2t(1 - 2r ^ 2) + t ^ 2]), {t, 0, 5}]CoefficientList[%, t]Compare with the directly computed sequence:
Table[ZernikeR[m + 2n, m, r], {n, 0, 5}] == %Verify the differential equation satisfied by the Zernike polynomial:
r^2(1 - r^2)z''[r] - r (3 r^2 - 1) z'[r] + (n (n + 2) r^2 - m^2) z[r] == 0 /. z -> Function[r, ZernikeR[n, m, r]]//FunctionExpand//FullSimplifyVerify recurrence relations satisfied by Zernike polynomials:
Table[ZernikeR[n + 2, m, r] == (n + 2/(n + 2)^2 - m^2)((4(n + 1)r^2 - ((n + m)^2/n) - ((n - m + 2)^2/n + 2))ZernikeR[n, m, r] - ((n - m)(n + m)/n)ZernikeR[n - 2, m, r])//Simplify, {n, 2, 9}, {m, Boole[OddQ[n]] + 2, n, 2}]Table[ZernikeR[n, m - 2, r] == (m - (m(m - 1)(n + m + 2)(n - m)/(m + 1)(n + m)(n - m + 2)) - (1/r^2)(4m(m - 1)/(n + m)(n - m + 2)))ZernikeR[n, m, r] + (((m + 1)(m + 2)/2) - (m + 2)(m - (m(m - 1)(n + m + 2)(n - m)/(m + 1)(n + m)(n - m + 2))) - (m(m - 1)(n + m + 4)(n - m - 2)/2(n + m)(n - m + 2)))ZernikeR[n, m + 2, r]//Simplify, {n, 2, 9}, {m, Boole[OddQ[n]] + 2, n, 2}]An integral representation of the radial Zernike polynomial:
Table[Simplify[(1/2π)Subsuperscript[∫, 0, 2π]ChebyshevU[n, r Cos[θ]]Cos[m θ]ⅆθ], {n, 0, 5}, {m, Boole[OddQ[n]], n, 2}]Compare with the result of ZernikeR:
Table[Simplify[ZernikeR[n, m, r]], {n, 0, 5}, {m, Boole[OddQ[n]], n, 2}]ZernikeR can be represented in terms of MeijerG:
Table[Assuming[0 < r < 1, Simplify[FunctionExpand[Cos[(π/2)(n - m)]^2MeijerG[{{}, {-(n/2), (n/2) + 1}}, {{-(m/2), (m/2)}, {}}, r, (1/2)]]]], {n, 0, 5}, {m, Boole[OddQ[n]], n, 2}]Table[Simplify[ZernikeR[n, m, r]], {n, 0, 5}, {m, Boole[OddQ[n]], n, 2}]Radial Zernike polynomials are orthogonal on the unit interval with weight function
:
MatrixForm /@ Table[2(n1 + 1)Integrate[r ZernikeR[n1, m, r]ZernikeR[n2, m, r], {r, 0, 1}], {m, 0, 3}, {n1, m, m + 6, 2}, {n2, m, m + 6, 2}]Neat Examples (1)
A function for converting from OSA/ANSI standard indexing to Zernike polynomial indices:
ansiIndex[j_Integer ? NonNegative] := With[{n = Ceiling[(Sqrt[8j + 9] - 3) / 2]}, {n, 2j - n(n + 2)}]Define the Zernike polynomial over the unit disk:
ZernikeZ[j_, r_, θ_] := Module[{n, m}, {n, m} = ansiIndex[j];If[m < 0, Sin[m θ], Cos[m θ]] ZernikeR[n, m, r]]Visualize the first few Zernike polynomials:
With[{n = 4}, TakeList[Table[DensityPlot[ZernikeZ[j, Norm[{x, y}], ArcTan[x, y]], {x, y}∈Disk[], IconizedObject[«options»]], {j, 0, Binomial[n + 1, 2] - 1}], Range[n]]//GraphicsGrid]Tech Notes
Related Guides
Related Links
History
Text
Wolfram Research (2007), ZernikeR, Wolfram Language function, https://reference.wolfram.com/language/ref/ZernikeR.html.
CMS
Wolfram Language. 2007. "ZernikeR." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ZernikeR.html.
APA
Wolfram Language. (2007). ZernikeR. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ZernikeR.html
BibTeX
@misc{reference.wolfram_2026_zerniker, author="Wolfram Research", title="{ZernikeR}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ZernikeR.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_zerniker, organization={Wolfram Research}, title={ZernikeR}, year={2007}, url={https://reference.wolfram.com/language/ref/ZernikeR.html}, note=[Accessed: 13-June-2026]}