% function draw_closed_line( h, xp, color )
% Draw a closed line connecting 'xp' points with a color 'color'
% to the figure 'h'.
function draw_closed_line( h, xp, color )
  
  figure( h )
  hold on;
  nxp = size( xp, 2 );
  for i = 1:nxp
    ii = mod( i, nxp ) + 1;
    plot3( [xp(1,i) xp(1,ii)], [xp(2,i) xp(2,ii)], [xp(3,i) xp(3,ii)], color );
%    pause
  end
