% find which set of 4 segments has the top of the tee
% assume that the Tee bar is the longest side in one set that has 3 other
% shorter segments that total about the same length
% also reorder the set to give the crossbar 1st, the 2 sidebars second
% and the foot last

function [flag,headset] = findheadset(set1,set2)

  [fnd1,head1] = doheadset(set1);
  [fnd2,head2] = doheadset(set2);
  if fnd1 & ~fnd2
    headset = head1;
    flag = 1;
    return
  end
  if ~fnd1 & fnd2
    headset = head2;
    flag = 1;
    return
  end

  % not found
  flag = 0;
  headset = head1;
  
        
