clear all;clc;close all
theta=(pi/180)*[0 10 20 30 40 50 60 70 80 90];

ft=[0 17.3 34.2 50 64.3 76.6 86.6 93.9 98.4 100];
polar(theta,ft,'+r')
X=[length(theta) sum(theta);sum(theta) sum(theta.^2)];
n=3;
for i=1:n
    for j=1:n
        X(i,j)=sum(theta.^(j+i-2));
    end
end
X(1,1)=length(theta);

for i=0:(n-1)
    Y(i+1,1)=sum((theta.^i).*ft);
end

a=X\Y;

y=0;
syms x
for i=1:n
y=y+a(i,1).*x.^(i-1);
end
x=0:pi/50:pi/2;
y=eval(y)
hold on
polar(x,y,'b-.')