<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Le 29/10/2013 11:37, Pierre Haessig a écrit :
<blockquote cite="mid:526F8FE4.30309@crans.org" type="cite">
<pre wrap="">def compare(point, other):
delta = point - other
argmax = np.abs(delta).argmax()
delta_max = delta[argmax]
if delta_max > 0:
return 1
elif delta_max < 0:
return -1
else:
return 0
This function returns a comparison of the coordinates with the biggest
absolute difference. Of course this doesn't define an <b class="moz-txt-star"><span class="moz-txt-tag">*</span>absolute order<span class="moz-txt-tag">*</span></b>
(since it doesn't exist). But I think it defines a <b class="moz-txt-star"><span class="moz-txt-tag">*</span>relative order<span class="moz-txt-tag">*</span></b> (if
this notion exists mathematically !!!!) which is indeed robust.</pre>
</blockquote>
In fact this comparison is not robust for points whose difference
has two coordinates of almost same absolute magnitude but of
different sign :<br>
<br>
p1 = np.array([1,-1,0])<br>
p2 = np.array([1,-1+1e-3,0])<br>
p3 = np.array([1,-1-1e-3,0])<br>
<br>
compare(p1,p1)<br>
Out[26]: 0<br>
<br>
compare(p1,p2)<br>
Out[27]: -1<br>
<br>
compare(p1,p3)<br>
Out[28]: 1<br>
<br>
sorry,<br>
Pierre<br>
</body>
</html>