1998-02-01 09:37:08 +08:00
|
|
|
#include "f2c.h"
|
|
|
|
|
|
|
|
#undef abs
|
|
|
|
#include <math.h>
|
2002-06-01 20:38:32 +08:00
|
|
|
extern double f__cabs (double, double);
|
|
|
|
void
|
|
|
|
pow_zz (doublecomplex * r, doublecomplex * a, doublecomplex * b)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
double logr, logi, x, y;
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
logr = log (f__cabs (a->r, a->i));
|
|
|
|
logi = atan2 (a->i, a->r);
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
x = exp (logr * b->r - logi * b->i);
|
|
|
|
y = logr * b->i + logi * b->r;
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
r->r = x * cos (y);
|
|
|
|
r->i = x * sin (y);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|