Atan2() Function Taking Long Time

Hi guys I am using the atan2() function in my code but it takes almost 1ms to run. Is there a faster way to do it or if I paste the code for the atan2 in my code that should run faster right? Is the atan2 available open source.

if I paste the code for the atan2 in my code that should run faster right?

You may lose the tiny overhead of a call if it gets inlined, but no, wrong.

if I paste the code for the atan2 in my code that should run faster right?

Wrong. If it takes x amount of time to execute when the code is in a library, it will take x amount of time to execute if the code is not in a library.

Thanks would appreciate your help on how to implement it faster.

Johnny1010: Thanks would appreciate your help on how to implement it faster.

Use a faster processor. Don't you think that if the atan2() function could be made faster, it would have been?

Google "CORDIC"

Try one of the trig identities.

I found out doing your own "approximated" functions work much faster. I think last time I borrowed some code from java trigonometry implementation as it was much faster than the c function.

Thanks guys the cordic thing has worked well