-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double check atan2 usage #22
Comments
Is arctan significantly faster than arctan2? |
I don't know, @jkentwallace had opinions though. |
LaurentRDC and bmorris3, I was concerned not so much about efficiency. Reading through Emilio's original writeup, (in which he used Matlab) he had a comment about using atan(z) vs atan2(y,x). Problem is that atan only goes from -p/2 to +pi/2, whereas atan2 goes from -pi to pi. (That's because in the ratio of x/y = z, not knowing the sign of x and/or y precludes getting the angle in the correct quadrant.) Quick question: does python support a function called Arg[a + i b]? Arg[] will return the phase angle of a complex number. |
@jkentwallace I believe what you're looking for is implemented in
|
Yes! That's it. Basically, this is the same as atan2. However, for those who might be lazy - ahem - you don't need to do atan2[imaginary,real], but just np.angle([]) instead. Just a thought... |
Let's double check that we're using
atan2
efficiently everywhere.The text was updated successfully, but these errors were encountered: