function measure()
[x y] = ginput(2)
plot(x, y, 'b-+');

range = sqrt( (x(2) - x(1))^2 + (y(2) - y(1))^2)
heading = atan2d(y(2) - y(1), x(2) - x(1));
heading = mod(90 - heading, 360)

textString = sprintf('range: %5.1f\nheading: %5.1f', range, heading);
text(mean(x), mean(y), textString); 