Post Reply 
Calculating ATAN2
12-02-2022, 09:50 PM
Post: #3
RE: Calculating ATAN2
(12-02-2022 08:41 PM)Matt Agajanian Wrote:  So, what would be the formula for ARG on the W516X?

I'm not familiar with that calculator but with Python you could use the following:
Code:
from math import pi, sqrt, atan

def arg(x, y):
    r = sqrt(x**2 + y**2)
    return pi if r + x == 0 else 2 * atan(y / (r + x))

It is based on the tangent half-angle formula:

\(
\begin{align}
\tan \tfrac{1}{2}\theta = \frac{\sin \theta}{1+\cos \theta}
\end{align}
\)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calculating ATAN2 - Matt Agajanian - 12-02-2022, 08:41 PM
RE: Calculating ATAN2 - Maximilian Hohmann - 12-02-2022, 09:48 PM
RE: Calculating ATAN2 - Matt Agajanian - 12-02-2022, 09:57 PM
RE: Calculating ATAN2 - Thomas Klemm - 12-02-2022 09:50 PM
RE: Calculating ATAN2 - Csaba Tizedes - 12-02-2022, 10:13 PM
RE: Calculating ATAN2 - Matt Agajanian - 12-02-2022, 11:21 PM
RE: Calculating ATAN2 - Csaba Tizedes - 12-03-2022, 07:10 AM
RE: Calculating ATAN2 - Matt Agajanian - 12-03-2022, 08:11 PM
RE: Calculating ATAN2 - Albert Chan - 12-03-2022, 03:43 AM
RE: Calculating ATAN2 - Matt Agajanian - 12-03-2022, 06:47 AM



User(s) browsing this thread: 1 Guest(s)