function draw_scanmatch(scanA,scanB,match)

if (nargin == 1)
    mapmatch = scanA;
    match = mapmatch.match;
    scanB = mapmatch.scanB;
    scanA = mapmatch.scanA;
end

h = draw_scan(scanA,1); set(h,'color','r'); 
hold on; 
h = draw_scan(scanB,1); set(h,'color','b');
hold off;

Na = size(scanA.data,1);
Nb = size(scanB.data,1);
N = size(match,1);

ptsA = mul_config(scanA.pose,[scanA.data(:,[3 4])'; zeros(1,Na)]);
ptsB = mul_config(scanB.pose,[scanB.data(:,[3 4])'; zeros(1,Nb)]);

x = [ptsA(1,match(:,1)); ptsB(1,match(:,2)); NaN*zeros(1,N)];
y = [ptsA(2,match(:,1)); ptsB(2,match(:,2)); NaN*zeros(1,N)];

hold on;
plot(x,y,'g-');
hold off;
axis equal