[PD] haversine formula in Pd

Cyrille Henry ch at chnry.net
Sat Jun 6 22:05:29 CEST 2015


hello,

pow 2 did not like negative number.
use "t f f" and "*" in order to compute the square of a number.

i correct 2 of your formula according to what i found in your link.
they both gives the same result : 11805
the same value computed with your 2nd link gives 12210.
for other value, it also look close. so i guess the difference is number precision.


cheers
c



Le 06/06/2015 20:18, Max a écrit :
> I tried to implement the Haversine formula in Pd which should give you
> the distance in km between two lat long coordinates.
>
> https://en.wikipedia.org/wiki/Haversine_formula
> http://www.movable-type.co.uk/scripts/latlong.html
>
> One huge obstacle is the imprecision of the 32bit floats, but even
> without that I can't get the formula to work. I kept 3 failed
> implementations in the test-case.
>
> http://rosettacode.org/wiki/Haversine_formula
>
> Could someone give me a hand please?
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loca.haversine-help.pd
Type: application/puredata
Size: 613 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150606/53222193/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loca.haversine.pd
Type: application/puredata
Size: 3673 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150606/53222193/attachment-0001.bin>


More information about the Pd-list mailing list