function calc(M)

X=-pi:.01:pi;
Y=X;
[A,B] = tpcoeff(X,Y,M);
x=-pi:.01:pi;
y=tp(A,B,x,M);
plot(x,y,X,Y,'-');