[A83] Distance finding routine


[Prev][Next][Index][Thread]

[A83] Distance finding routine



Here is my distance finding routine.

The main code:
http://www.netspaceonline.net/netspace/mmarshall/Pythagorean.asm

The LUT:
http://www.netspaceonline.net/netspace/mmarshall/PythagoreanLUT.inc

The C++ code for generating the LUT:
http://www.netspaceonline.net/netspace/mmarshall/main.cpp

In my testing it seems to work great.  I would appreciate if someone would
look at it and tell me any ways to make it better.  (I am not very good at
asm yet.)
The basic idea is that...
sqrt(46^2+52^2) = sqrt(4^2+5^2)*10 + sqrt(6^2+2^2)

I did a few comments, but if you can't understand how it works, let me know.

MWM

Post Script: I hadn't noticed until writing this e-mail, that the only thing
that has to do with Pythagorean's theroem is the code for generating the
LUT.  I suppose that I should have named the routine "FindDistance" rather
than "Pythagorean".