On 26 Dec 2013, at 10:58, Yuriy Tymchuk <yuriy.tymc...@me.com> wrote:

> If no one has nothing agains it, I will move this Q/A on StackOverflow.

With proper attribution, please do.

> Uko
> 
> On 26 Dec 2013, at 11:35, Sven Van Caekenberghe <s...@stfx.eu> wrote:
> 
>> Hi Esteban,
>> 
>> On 26 Dec 2013, at 02:23, Esteban A. Maringolo <emaring...@gmail.com> wrote:
>> 
>>> Answering myself...
>>> 
>>> I found a solution and transcribed it: http://pastebin.com/ThKDXCKK
>> 
>> This is the formula that we have been using for years in Pharo, 
>> Java[Script], Common Lisp:
>> 
>> distanceBetween: firstPosition and: secondPosition
>> "T3GeoTools distanceBetween: 5.33732@50.926 and: 5.49705@50.82733"
>> 
>> | c |
>> c := (firstPosition y degreeSin * secondPosition y degreeSin)
>>      + (firstPosition y degreeCos * secondPosition y degreeCos
>>         * (secondPosition x degreesToRadians - firstPosition x 
>> degreesToRadians) cos).
>> c := c >= 0 ifTrue: [ 1 min: c ] ifFalse: [ -1 max: c ].
>> ^ c arcCos * 6371000
>> 
>> This is between WGS84 coordinates. It seems simpler than yours. We have been 
>> using this page as reference:
>> 
>> http://www.movable-type.co.uk/scripts/latlong.html
>> 
>> Regards,
>> 
>> Sven
>> 
>>> Esteban A. Maringolo
>>> 
>>> 
>>> 2013/12/25 Esteban A. Maringolo <emaring...@gmail.com>:
>>>> Has anybody implemented basic methods/classes to calculate distance
>>>> between two points (lat, long) and similar operations?
>>>> 
>>>> Regards,
>>>> 
>>>> Esteban A. Maringolo
>>> 
>> 
>> 
> 
> 


Reply via email to