# ZernikePolynomialGenerator¶

class rubin_sim.utils.ZernikePolynomialGenerator

Bases: `object`

A class to generate and evaluate the Zernike polynomials. Definitions of Zernike polynomials are taken from https://en.wikipedia.org/wiki/Zernike_polynomials

Methods Summary

 `evaluate`(r, phi, n, m) Evaluate a Zernike polynomial in polar coordinates `evaluate_xy`(x, y, n, m) Evaluate a Zernike polynomial at a point in Cartesian space. `norm`(n, m) Return the normalization of the n, m Zernike polynomial

Methods Documentation

evaluate(r, phi, n, m)

Evaluate a Zernike polynomial in polar coordinates

r is the radial coordinate (a scalar or an array)

phi is the angular coordinate in radians (a scalar or an array)

n is the radial order of the polynomial

m is the angular order of the polynomial

Return the value(s) of the polynomial at r, phi (returns np.NaN if r>1.0)

evaluate_xy(x, y, n, m)

Evaluate a Zernike polynomial at a point in Cartesian space.

x and y are the Cartesian coordinaes (either scalars or arrays)

n is the radial order of the polynomial

m is the angular order of the polynomial

Return the value(s) of the polynomial at x, y (returns np.NaN if sqrt(x**2+y**2)>1.0)

norm(n, m)

Return the normalization of the n, m Zernike polynomial

n is the radial order

m is the angular order