Yes, I know De Moivre' s theorem. It' s expressed in polar coordinate. F/F95
use the
rectangular form. Then I was thinking to set up a data structure in a module
to
covert the numbers in transparent mode.
However, it is preferible using a subroutine or function (elemental ?).
I apologize for my bad english
Giuseppe
----- Original Message -----
From: "R. A. Vowels" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Monday 23 June 2003 4:49 PM
Subject: Re: Complex root
> > Date: Mon, 23 Jun 2003 09:26:00 +0200
> > From: Giuseppe Panei <[log in to unmask]>
>
> > I am learning F95
> > The intrinsic sqrt (z) for z complex yields only a result.
> > Really, the square root of z=x+i y ( z=ro * exp(i*tet) ) is
> >
> > z1 = ro1 * exp (i tet1)
> > z2 = ro1 * exp (i tet2)
> >
> > where
> > ro1 = sqrt (ro)
> > tet1 = tet / 2
> > tet2 = tet1 + k * pi k = 1, 2, .....
> >
> > If I need all the solutions, have I write a module to overwrite the
original
> > intrinsic ? (This new intrinsic maintain the same name as original.)
>
> No, they can be computed, making use of De Moivre's
> theorem
>
> > If I want all the n-root of z = z1 ** (1 / n) must be overwritten the **
> > operator?
>
> Again, no. There's an example in my book for the general case of
z**(1/n):
> "Algorithms and Data Structures in F and Fortran", pages 147-148.
>
> > I am sorry for these simple problems, but my F book is coming from USA.
> > Thanks in advance
> >
> > Giuseppe
|