Hi guys,
Is there a quick and easy approximation to arctangent2(y,x) that is simpler than CORDIC (what I'm using now) and accurate to within a few degrees? My x and y inputs are 16-bit signed integers. I want a 16-bit result that goes from 0 to 65535 as the angle goes from 0 to 360 degrees. I don't mind some decreased accuracy when x and y are both small.
I already have a satisfactory approximation for my magnitude calculation:
Instead of sqrt(x*x + y*y), I use 0.95 * max(x,y) + 0.387 * min(x,y).
That is accurate to about one percent, and is easy to pipeline in Virtex II. Of course I scale it into integer arithmetic.