[sf.cmath.sph.legendre]

# 29 Numerics library [[numerics]](./#numerics)

## 29.7 Mathematical functions for floating-point types [[c.math]](c.math#sf.cmath.sph.legendre)

### 29.7.6 Mathematical special functions [[sf.cmath]](sf.cmath#sph.legendre)

#### 29.7.6.21 Spherical associated Legendre functions [sf.cmath.sph.legendre]

[ð](#lib:sph_legendre)

`floating-point-type sph_legendre(unsigned l, unsigned m, floating-point-type theta);
float        sph_legendref(unsigned l, unsigned m, float theta);
long double  sph_legendrel(unsigned l, unsigned m, long double theta);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10760)

*Effects*: These functions compute the spherical associated Legendre functions
of their respective argumentsl, m, and theta (theta measured in radians)[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10766)

*Returns*: Yâm(Î¸,0),
where Yâm is given by Formula [29.41](#eq:sf.cmath.sph.legendre),l is l,m is m, andÎ¸ is theta[.](#2.sentence-1)

Yâm(Î¸,Ï)=(â1)m[(2â+1)4Ï(ââm)!(â+m)!]1/2Pâm(cosÎ¸)eimÏÂ , forÂ |m|â¤â(29.41)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10780)

*Remarks*: The effect of calling each of these functions
is implementation-defined
if l >= 128[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10786)

See also [[sf.cmath.assoc.legendre]](sf.cmath.assoc.legendre "29.7.6.3 Associated Legendre functions")[.](#4.sentence-1)
