>Task: approximation in assembler to
>-> a = sqrt ( b*b + c*c ) let's call it sentence of p...
>
>Well, I need a _FAST_ approximation.
>The simpliest is: a+b
>(I know, it is NO real approx., but it is simple...)
there's another fun approx, it's very rough though:
p:= max(a,b)+0.25*min(a,b)
note: the 0.25* can be calculated by srl commands...
I used this in Black Cyclon (look at my pages if you don't know the game) to
approximate the distance of each enemy to the player.
>Can someone of you tell me a "better" (fast) one?
>The values vary from 0 to 8.
>btw: I dont want to use a table, is there a way?
why not? just 81 bytes required, not that much data....
Cas Cremers
Parallax MSX Games
http://www.stack.nl/~cas/par/
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****