[A83] arctan
[Prev][Next][Index][Thread]
[A83] arctan
For my turn, I have a really annoying question to all of
you: fast arctan, or rather arctan2 for two 8-bit
coordinates with a 8-bit output as well. The algorithm
doesn't need to have a deadly precision, and error of
around +/- 5 degrees is acceptable. A maximum running time
of about 1500 cycles should be possible.
I was thinking about creating a 16x16 table of angles and
divide the coordinates into two nibbles each (so I get the
final vector as the sum of two vectors: one made up of the
higher nibbles and the other from the lower nibbles). The
higher nibbles could be used to point directly into the
table, and the lower nibbles could provide some additional
precision, but I don't know how.
If anyone can think of something useful, I'd be glad to
hear it.
PG
Follow-Ups:
References: