logo separator

[mkgmap-dev] Commit: r1050: Improve performance of distance calculations.

From Johann Gail johann.gail at gmx.de on Sat May 30 18:43:24 BST 2009

Hi Mark,

i didn't want to upset you.
Its your code, well code btw., and you can name the functions as you like.

But from the sight of a progrommer not so deep in the internals of 
mkgmap, it seems to me clearer to choose from the functions 
quickDistance() and exactDistance().


>> May I propose to rename the function slowDistance() to exactDistance()?
>> I think the main reason for this function is not to be slow, but to be 
>> the exact calculation.
>>     
>
> It doesn't want to be slow but it just is because acos() is a complete
> dog.
>
> But how do you know it's exact anyway? Have you tested it in any
> way?
>   
No, but I know that the calculation formula is another one and is more 
expensive, but should deliver the correct distance.
> Also, while you are at it, why not propose that quickDistance() is
> renamed
> notQuiteSoExactDistanceButProbablyGoodEnoughThatNoOneWillNotice()?
>
> And anyway, even if quickDistance() does not produce as accurate a
> result as slowDistance(), as long as the result is good enough for the
> calculation being performed we're better off with the speed increase.
>
>   
Yes, I know that and fully agree to that.
> I am happy with the names as they are.
>
>   
Then dont change it. It was only a suggestion.

Regards,
Johann



More information about the mkgmap-dev mailing list