Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Quick and easy atan2?

Status
Not open for further replies.

echo47

Advanced Member level 6
Advanced Member level 6
Joined
Apr 7, 2002
Messages
3,933
Helped
638
Reputation
1,274
Reaction score
90
Trophy points
1,328
Location
USA
Activity points
33,176
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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top