John Payson
()
Mon Sep 16 2002 12:12 PM
Re:Distance function sqrt(a*a+b*b [+c*c...])


>I only compute a^2+b^2 for every object and check it against d^2 (i compute d^2 only once).

In this application, for compatibility reasons, it is probably necessary to compute the actual distance (the PIC feeds numbers to another micro).  Since that other micro does a table lookup to compute the log of the numbers fed it, it may be possible to rework things to return the square rather than sqrt, but I recall reading somewhere that there was a way of computing or approximating the distance function which was as cheap or cheaper than computing the squares, let alone the square root.



Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5