import numpy as np
import math
from newtonPoly import *
xData = np.array([0.15,2.3,3.15,4.85,6.25,7.95])
yData = np.array([4.79867,4.49013,4.2243,3.47313,2.66674,1.51909])
a = coeffts(xData,yData)
print(" x yInterp yExact")

print("-----------------------")
for x in np.arange(0.0,8.1,0.5):
    y = evalPoly(a, xData, x)
    yExact = 4.8 * math.cos(math.pi * x / 20.0)
    print(x, y, yExact)
input("\nPress return to exit")