Velocity Reviews > Calculating distances in O(1)

# Calculating distances in O(1)

Gordon Burditt
Guest
Posts: n/a

 01-14-2006
>Let's look at another example:
>
>Atlanta to Houston: 790 mi
>Houseton to New York: 1610 mi
>New York to Norfolk: 370 mi
>
>By your logic, the distance between Atlanta to Norfolk would be 2770
>mi, while it is actually about 560 mi.

The first example may be correct, if you're talking about airline
miles rather than as-the-missile-flies distances.

>The problem you describe is usually solved by storing the position of
>each city, say the latitude and longitude, then calculating the
>distance between the two positions. This way all you need to do is
>look up the two positions and perform the distance calculation.

Unfortunately, it's not possible to GET a (nonstop) commercial
flight from Airport A to Airport B for all possible pairs of A and
B. Things such as the Wright Amendment make certain (commercial)
flights illegal, and others just don't have enough traffic to make
them worthwhile. Also, some airports may not be able to handle all
flights (an intercontinental flight from Paris, France to Northwest
Pothole, Texas may find the runways too short for anything but crop
dusters to land).

Gordon L. Burditt

racygirl
Guest
Posts: n/a

 01-17-2006
Whatever

Chuck F.
Guest
Posts: n/a

 01-17-2006
racygirl wrote:
>
> Whatever

I think you have been told enough times how to include proper
context even on the google interface, and you just ignore it. I
for one don't want to put up with these meaningless postings, so
goodbye. PLONK (which means your posts will never reach here in
the future).

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the

Default User
Guest
Posts: n/a

 01-17-2006
racygirl wrote:

> Whatever

*plonk*

Brian