18 lines
312 B
C
18 lines
312 B
C
|
#include "f2c.h"
|
||
|
|
||
|
VOID pow_zz(r,a,b)
|
||
|
doublecomplex *r, *a, *b;
|
||
|
{
|
||
|
double logr, logi, x, y;
|
||
|
double log(), exp(), cos(), sin(), atan2(), cabs();
|
||
|
|
||
|
logr = log( cabs(a->r, a->i) );
|
||
|
logi = atan2(a->i, a->r);
|
||
|
|
||
|
x = exp( logr * b->r - logi * b->i );
|
||
|
y = logr * b->i + logi * b->r;
|
||
|
|
||
|
r->r = x * cos(y);
|
||
|
r->i = x * sin(y);
|
||
|
}
|