A little help understanding math....
08-15-2021, 03:48 AM
Post: #5
 Albert Chan Senior Member Posts: 2,142 Joined: Jul 2018
RE: A little help understanding math....
(12-16-2013 11:56 PM)Thomas Klemm Wrote:  Let's assume $$w=u+iv$$. Then
\begin{align} z&=&x+iy=cos(w)=cos(u+iv) \\ &=&cos(u)cos(iv)-sin(u)sin(iv) \\ &=&cos(u)cosh(v)-i sin(u)sinh(v) \\ \end{align}...
Code:
    u = acos(x/W)     v = acosh(W)     return u - 1j*v

There is a flaw with the code, arc function only give principle branch.
We have to match sign of imaginery part.

From above code, 0 ≤ u ≤ pi, v ≥ 0, sign(-sin(u) * sinh(v)) = negative
If y is also negative, no correction needed, else we flip sign.

This is the patch:

< return u - 1j*v
> return complex(u, v if y<0 else -v)
 « Next Oldest | Next Newest »

 Messages In This Thread A little help understanding math.... - Thomas Klemm - 12-16-2013, 11:56 PM RE: A little help understanding math.... - Paul Dale - 12-17-2013, 10:19 AM RE: A little help understanding math.... - Namir - 12-17-2013, 01:17 PM RE: A little help understanding math.... - Thomas Klemm - 12-17-2013, 03:04 PM RE: A little help understanding math.... - Albert Chan - 08-15-2021 03:48 AM RE: A little help understanding math.... - Albert Chan - 08-15-2021, 12:25 PM RE: A little help understanding math.... - Albert Chan - 08-26-2021, 02:31 PM RE: A little help understanding math.... - Albert Chan - 08-26-2021, 06:16 PM RE: A little help understanding math.... - Albert Chan - 08-29-2021, 12:20 AM

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