[VA] SRC #009 - Pi Day 2021 Special
|
03-17-2021, 02:32 AM
(This post was last modified: 03-17-2021 11:26 AM by Albert Chan.)
Post: #24
|
|||
|
|||
RE: [VA] SRC #009 - Pi Day 2021 Special
(03-16-2021 09:09 PM)robve Wrote: $$ \arctan u - \arctan v = \arctan\frac{u-v}{1+uv} $$ This is not quite right, LHS has possible range of ±pi, RHS is limited to ±pi/2 Correct identity is more complicated: see Sum of ArcTangents We could use this instead: atan(u) ± atan(v) = atan2(u±v , 1∓uv) (*) y = atan(x) - atan((x-1)/(x+1)) // y undefined when x = -1 = atan2(x - (x-1)/(x+1), 1 + x*(x-1)/(x+1)) = atan2((x²+1)/(x+1), (x²+1)/(x+1)) // numerator always positive. If x > -1, 4*y = 4*atan(1) = pi If x < -1, 4*y = 4*(atan(1) - pi) = -3*pi (*) Proof is trivial: (1+u*i) * (1±v*i) = (1∓u*v) + (u±v)*i Phase angle of two sides matched, and we have above atan2 identity |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)