bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / special / _orthogonal / gegenbauer
function
scipy.special._orthogonal:gegenbauer
source: build-install/usr/lib/python3.14/site-packages/scipy/special/_orthogonal.py:2085
Signature
def gegenbauer(n, alpha, monic = False)Summary
Gegenbauer (ultraspherical) polynomial.
Extended Summary
Defined to be the solution of the second-order linear ordinary differential equation
for ; is a polynomial of degree .
Parameters
n: intDegree of the polynomial.
alpha: floatParameter, must be greater than -0.5.
monic: bool, optionalIf True, scale the leading coefficient to be 1. Default is False.
Returns
C: orthopoly1dGegenbauer polynomial.
Notes
The polynomials are orthogonal on with respect to the weight function .
Examples
import numpy as np from scipy import special import matplotlib.pyplot as plt✓
p = special.gegenbauer(3, 0.5, monic=False) p✓
poly1d([ 2.5, 0. , -1.5, 0. ])
p(1)
✗np.float64(1.0)To evaluate ``p`` at various points ``x`` in the interval ``(-3, 3)``, simply pass an array ``x`` to ``p`` as follows:
x = np.linspace(-3, 3, 400) y = p(x)✓
fig, ax = plt.subplots()
✓ax.plot(x, y) ax.set_title("Gegenbauer (ultraspherical) polynomial of degree 3") ax.set_xlabel("x") ax.set_ylabel(r"$C_3^{(0.5)}(x)$")✗
Text(0, 0.5, '$C_3^{(0.5)}(x)$')
plt.show()
✓
Aliases
scipy.special.gegenbauer