comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: complex arithmetic
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: complex arithmetic [message #1919 is a reply to message #1918] Wed, 06 April 1994 07:36 Go to previous messageGo to previous message
salchegg is currently offline  salchegg
Messages: 1
Registered: April 1994
Junior Member
I tried

IDL> z = complex(0.0,1.0)
IDL> print,exp(alog(z)/3)
( 0.866025, 0.500000)
IDL>
1/3 ln(z)/3
This is correct z = e but unfortunately incomplete.

Because:

Let n be an integer and z a complex number then
1/n
z has n solutions in the complex plane (de Moivre !!)

This would mean that IDL should have to make a new array with the solutions:
v = exp(alog(z)/3). This does not happen.
Out of v(0),..,v(n-1) only v(0) is computed.

On the other hand the original question in the first posting told us about problems with
the more general problem:

Let u,v be complex numbers.
v
If we want to compute z = u = exp(v Ln(u)), we have to handle the problem with the
complex logarithm (Ln):

Ln(u) = ln |z| + i (\varphi_0 + 2k\pi) with k = {0,+/- 1, +/- 2, ...}

and -\pi < \varphi_0 \le \pi

BUT: IDL's alog(z) only computes one value.

IDL> z = complex(0.,1.)
IDL> print, exp(alog(z)/3.0)
( 0.866025, 0.500000)
IDL> v = z
IDL> print, exp(v*alog(z)) i -pi/2
( 0.207880, 0.00000) which is i = e
IDL>


Markus


| Markus Salchegger University of Salzburg, Austria |
| Research Institute f. Software Technology (RIST++) |
| email: salchegg@coma.sbg.ac.at |
| <A HREF="http://www.coma.sbg.ac.at/~salchegg/pers.html">WWW</A> |
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL Map Projections ( PLATE CARREE )
Next Topic: JPEG routines for IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 13:24:20 PDT 2025

Total time taken to generate the page: 0.00621 seconds