function b=harm(x)
%given a three-vector of the boundary points of a harmonic function, this
%computes the harmonic extension to the next level. I use this in the
%program "harmonic" repetedly to generate all values of a harmonic function
%at any level. This program uses the 1/5-2/5 rule. Note that the b vector
%has nine entries instead of six, which is due to our method of defining
%functions as vectors on SG (see comments on our main page for programs).
b=zeros(1,9);
b(1)=x(1); b(5)=x(2); b(9)=x(3);
b(2)=1/5*(2*x(1)+2*x(2)+x(3)); b(4)=b(2);
b(3)=1/5*(2*x(1)+x(2)+2*x(3)); b(7)=b(3);
b(6)=1/5*(x(1)+2*x(2)+2*x(3)); b(8)=b(6);
