function x=harmonic(z,m)

%defines vector of values of a harmonic function on level m SG graph given
%the boundary points z.

x=z;
for n=1:1:m
    s=max(size(x));
        y=[];
        for i=1:1:s/3
        y=[y harm(x(1,3*i-2:3*i))];
        end
        x=y;
end

%gaskplot(x,m)

%{
q0=[1/2 1]; q1=[0 0]; q2=[1 0];
q=[1/2 1; 0 0; 1 0];
y=q;
for i=1:1:m
    y=[wordm(y,q0); wordm(y,q1); wordm(y,q2)];
end
hold off
for n=1:1:3^(m)
    hold on
    
    plot3([y(3*n-2:3*n,1); y(3*n-2,1)],[y(3*n-2:3*n,2) ;y(3*n-2,2)] ,[x(3*n-2:3*n); x(3*n-2)])
end
plot3(y(:,1),y(:,2),x)
%}





