Re: Vector Rotation



On Sun, 26 Feb 2006 23:07:27 -0500, Carlos Moreno
<moreno_at_mochima_dot_com@xxxxxxxxxxxxxx> wrote:

How bad is a square root and a divide on your platform?

Bad enough that they are almost universally avoided.

Both square root and division can be done via Newton-Raphson
if you can do multiplications (for the division, use N-R to
find the inverse, then multiply).

A good suggestion. For some reason I seem to overlook Newton-Raphson as
one of the "obvious" choices; I guess I've never liked the fact that it
can diverge in some cases. Should be no such problems in this
situation.

The only alternative that comes to mind (which does not mean
that it is the only alternative, of course) is to do binary
search on the magnitude -- or rather, on the scaling factor
for vector B required to obtain A'

Conceptually I like this idea. Even though it requires as many stages
as there are bits in the data word, its simplicity is attractive.

Many thanks,
Greg Berchin
.