The legendre(l,x) function evaluates a Legendre polynomial
Pl(x) of integer degree
l:
The legendre(l,m,x) function evaluates an associated Legendre polynomial

of integer degree
l and order
m:
The degree l must be a nonnegative constant integer, and the order
m must be a constant integer. For

,
legendre(l,m,x) returns zero.
The sphericaly(l,m,theta,phi) function evaluates the spherical harmonic function

:
where Pl is the Legendre polynomial of degree
l. The degree
l must be a nonnegative constant integer, and the order
m must be a constant integer. For

,
sphericaly(l,m,theta,phi) returns zero.
The sphericalyr(l,m,theta,phi) function evaluates the real spherical harmonic function

:
The degree l must be a nonnegative constant integer, and the order
m must be a constant integer. For

,
sphericalyr(l,m,theta,phi) returns zero. The arguments
θ and

must be real.
The zernike(m,n,r,phi) function evaluates a Zernike polynomial

defined in the following way:
and
is the normalization factor. The n argument is required to be a nonnegative constant integer, and the
m argument is required to be a constant integer satisfying

. The
r and

arguments are required to be real.