When it comes to searching for appropriate algorithms, *always* have a
go at Google (http://www.google.com) before posting a question.  Odds
are really good the topic has been discussed before.

If you want a Palm-specific answer, try looking at
http://www.escribe.com.

That being said, I'm curious exactly *why* you need to calculate square
roots many times?  Is it for collision detection within a game?  (Again,
try taking a search through google for that!)

If it *is* for collision detection, think about whether or not you
really want to be doing a square root at all. (There are other ways.)

-Ken

On Mon, 2003-03-17 at 09:49, Dan Patrutiu wrote:
>    Hello to all. I know this topic is not a Palm-specific one, but Palm is a
> place where it applies, because of the known limitations the processor have.
> 
>     So, I need to calculate the distance between two points (x1,y1) and
> (x2,y2) for very much times. That is, calculating the
> sqrt((x2-x1)^2+(y2-y1)^2). The problem is that, using floating point to do
> this is very slow and this is time critical for me. I am interested in an
> approximation which doesn't eat so much cycles and returns a quite close
> result (I only need the integer square root).
> 
>     Thanks in advance,
>     Dan Patrutiu
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
> http://www.palmos.com/dev/support/forums/




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to