>Given two or three numbers, byte or int16, what
>is the best way to compute the "distance"
>function (square root of the sum of squares)?
>Certainly computing the square root of the sum of
>squares is possible, but it seems needlessly
>expensive in terms of CPU time. Can anyone offer
>a better algorithm for the PIC16x?
I can't offer a better algorithm, but I can
point you to a square root routine I used
when I need to take a square root of a 16-bit
integer as fast as possible.
It's in assembly, but can be "inlined" into C
code (what I did).
http://www.dattalo.com/technical/software/pic/picsqrt.html
Bill