A question about clabel.m
In function plus_labels, we pull the x and ycoordinates
of all contours in arrays x and y.
We then construct a complex variable
xylist = (x .* yrange + sqrt(1) .* y .* xrange);
Next, we do a similar thing with the coordinates of a
clicked point xx and yy:
xy = xx .* yrange + sqrt(1) .* yy .* xrange;
Now we use function 'min' to find the index of the point,
at which the minimal distance between the two vectors is
achieved. All right, I understand this. But why multiplying
x by yrange and y by xrange in both cases? What is the
purpose of such mirror multiplication? It simply rescales x
and y by a factor.
I verified: removal of xrange, yrange from the above 2
statements does not change anything.
Am I missing something?
(Same with function inline_labels, although I did not check
it).
Thanks,
Yuri
