LegendreP

LegendreP[nx]
returns the Legendre polynomial P_n(x).
LegendreP[nmx]
returns the associated Legendre polynomial P^m_n(x).

LegendreP can be used to draw generalized Lissajous figures: