{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Interpolate $\\cos(x)$ on uniform points"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let us interpolate $\\cos(x)$ on uniformly spaced points in the interval $[0,2\\pi]$."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"from numpy import pi,cos,linspace,polyfit,polyval\n",
"from matplotlib.pyplot import figure,subplot,plot,axis,text"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"