finding euclidean distance,better code?

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Sat Mar 29 08:06:27 EDT 2008


Steven D'Aprano schreef:
> On Sat, 29 Mar 2008 10:11:28 +0100, Roel Schroeven wrote:
> 
>> Steven D'Aprano schreef:
>>> On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote:
>>>
>>>> Gabriel Genellina wrote:
>>>>> That's what I said in another paragraph. "sum of coordinates" is
>>>>> using a different distance definition; it's the way you measure
>>>>> distance in a city with square blocks. I don't know if the distance
>>>>> itself has a name, but
>>>> I think it is called Manhattan distance in reference of the walking
>>>> distance from one point to another in this city.
>>> You know, there are other cities than Manhattan. Some of them even have
>>> streets and blocks.
>> I'm not sure what your point is. The name 
> 
> "The" name? You go on to list four additional names, so why do you say 
> that "Manhattan distance" is THE name? When I studied this at university, 
> we called it the taxi metric. 
> 
> 
>> of the distance happens to be
>> Manhattan distance (or taxicab distance, rectilinear distance, L1
>> distance, city block distance; see
>> http://en.wikipedia.org/wiki/Manhattan_distance) so Robert has a valid
>> point.
> 
> Wikipedia doesn't believe that M-D is the primary or most common name, 
> and the link you give redirects to "Taxicab distance". Googlefight 
> agrees: "Taxicab distance" is more than twice as common, and "rectilinear 
> distance" more than five times as common.
> 
> My point was to draw attention to Robert's unconscious assumptions which 
> are reflected in his choice of language. Rectilinear distance applies to 
> more than "distance from one point to another in THIS city" (emphasis 
> added).

You can hardly blame that on Robert. It's true that Manhattan distance 
is not the only name and not even the most popular one, but it's also 
true that it's a valid name, and that Robert didn't invent it, he merely 
used an existing name.

> It applies in parts of Rome, Sydney, London, Moscow and many other 
> places. It even applies to sleepy little country towns like Bendigo and 
> Mildura here in Australia. Manhattan is hardly the only place where 
> cities are carved up into rectangular or square city blocks, and I doubt 
> that it applies to the entirety of Manhattan.

No, but it's actually very close.

I just looked at the places you mention in Google Earth; while they do 
have sections with rectangular layouts, in none of them it is as 
prevalent and obvious as in Manhattan (Manhattan isn't a city of course 
like the other ones, it's only a part of New York).

Now of course it's true that there are many other places with checker 
board layouts, but I still don't think that makes Manhattan distance a 
bad name.

> The very name is New York-centric, just as much as if the English called 
> the science of acoustics "Big-Ben-onics" in reference to the peals of Big 
> Ben's clock. I had thought I had pointed that out with a little gentle 
> understatement.

I'm absolutely not USA/America/New York centric myself, but Manhattan 
simply is a good and well-known example of a checker board layout.

There are worse examples of bad names: 'French fries' for example is 
French-centric, but that's not the real problem. The real problem is 
that the name is simply wrong because fries are Belgian (which is 
disputed, but I believe it since I'm from Belgium ;) ). But I'm still 
not going the call them freedom fries or anything.

In any case, I replied because your reaction didn't feel all that gentle 
to me; to be honest, it felt rather rude. I apologize for interpreting 
the tone incorrectly.

-- 
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
   -- Isaac Asimov

Roel Schroeven



More information about the Python-list mailing list