% given N points and a triangulation of these points
% draw the inscribed circles 
function radii=find_radii(x,y,tri)
   N=size(tri,1);
   radii=zeros(N,3);
   for n=1:N
       a=x(tri(n,1))+i*y(tri(n,1));
       b=x(tri(n,2))+i*y(tri(n,2));
       c=x(tri(n,3))+i*y(tri(n,3));
       theta_a=abs(imag(log( (b-a)/(c-a) ) )/2);
       theta_b=abs(imag(log( (a-b)/(c-b) ) )/2);
       theta_c=abs(imag(log( (a-c)/(b-c) ) )/2);
       2*(theta_a+theta_b+theta_c);
       rad_a=cos(theta_a)*abs(a-c)*sin(theta_c)...
                  /sin(pi-theta_a-theta_c);
       rad_b=cos(theta_b)*abs(b-a)*sin(theta_a)...
                  /sin(pi-theta_b-theta_a);
       rad_c=cos(theta_c)*abs(c-b)*sin(theta_b)...
                  /sin(pi-theta_c-theta_b);
        
       
       % draw circular arc connecting tangent points
       plot_prop_arc(a,b,c,rad_a)
       plot_prop_arc(b,a,c,rad_b)
       plot_prop_arc(c,a,b,rad_c)
      
       
   end % for n
return
