{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Roots of Chebyshev polynomial"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The roots of degree $n$ Chebyshev polynomial $T_n(x)$ are\n",
"$$\n",
"x_i = \\cos\\left( \\frac{2i+1}{2n} \\pi \\right), \\qquad i=0,1,\\ldots,n-1\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.figure(figsize=(9,10))\n",
"c = 1\n",
"for n in range(10,20):\n",
" j = np.linspace(0,n-1,n)\n",
" theta = (2*j+1)*np.pi/(2*n)\n",
" x = np.cos(theta)\n",
" y = 0*x\n",
" plt.subplot(10,1,c)\n",
" plt.plot(x,y,'.')\n",
" plt.xticks([]); plt.yticks([])\n",
" plt.ylabel(str(n))\n",
" c += 1"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}