Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

ATAN within [0,2pi)

Intel_C_Intel
Employee
1,069 Views
I want to take the arctangent of y/x, with the output in the range [0,2pi). Is there a more elegant way than using

angle = AMOD(ATAN2(y,x)+TWOPI,TWOPI)

where I have defined TWOPI as a parameter?
0 Kudos
1 Reply
Intel_C_Intel
Employee
1,069 Views
0.5*TWOPI-ATAN2(Y,-X)
0 Kudos
Reply