Re: [Tutor] Fastest (x,y) distance calculation

Magnus Lycka magnus at thinkware.se
Thu Sep 11 09:54:34 EDT 2003


Raymond Hettinger:
> Distance calculations are much cheaper if you store the coordinates
> as complex numbers and use abs().

I tried that, and the distance calculation (pos-tmp.rect)
got much quicker, but abs() ate up all the improvement. :(

-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus at thinkware.se



More information about the Tutor mailing list