{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chebyshev points"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Chebyshev points are defined in the interval $[-1,+1]$. They are obtained as projections of uniformly spaced points on the unit circle onto the $x$-axis. For any $N \\ge 2$ they are defined as follows\n",
"$$\n",
"\\theta_i = \\frac{\\pi i}{N-1}, \\qquad x_i = \\cos(\\theta_i), \\qquad i=0,1,\\ldots,N-1\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"from numpy import pi,linspace,cos,sin\n",
"from matplotlib.pyplot import plot,axis,title"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"t = linspace(0,pi,1000)\n",
"xx = cos(t)\n",
"yy = sin(t)\n",
"plot(xx,yy)\n",
"\n",
"N = 10\n",
"theta = linspace(0,pi,N)\n",
"plot(cos(theta),sin(theta),'o')\n",
"for i in range(N):\n",
" x1 = [cos(theta[i]), cos(theta[i])]\n",
" y1 = [0.0, sin(theta[i])]\n",
" plot(x1,y1,'k--',cos(theta[i]),0,'sr')\n",
"axis([-1.1, 1.1, 0.0, 1.1])\n",
"axis('equal')\n",
"title(str(N)+' Chebyshev points');"
]
}
],
"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": 1
}