-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Merci Cyrille,
in the formula the intermediate steps are quite small fractions and it seems their precision is important. In the test case the Pd implementation is 8917.74 km off the proper result (2887.26). However I need a precision of about 1m. So I assume the haversine formula is not implementable in Pd at all? (unless double precision will be there that is) Or is there a workaround? m. On 2015년 06월 07일 05:05, Cyrille Henry wrote: > 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? >> >> >> >> _______________________________________________ >> [email protected] mailing list UNSUBSCRIBE and >> account-management -> >> http://lists.puredata.info/listinfo/pd-list >> > > > _______________________________________________ > [email protected] mailing list UNSUBSCRIBE and > account-management -> http://lists.puredata.info/listinfo/pd-list > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVzsO0ACgkQ3EB7kzgMM6KETQCfRvgOmpqbmyhZaH2Y5hzsRHlC XOgAnR+6lqxJfjTj5k7vR747UU8ATrqA =pBZv -----END PGP SIGNATURE----- _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
