|
Last change
on this file since 603 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
482 bytes
|
| Line | |
|---|
| 1 | #include "f2c.h"
|
|---|
| 2 |
|
|---|
| 3 | #ifdef KR_headers
|
|---|
| 4 | double log(), exp(), cos(), sin(), atan2(), f__cabs();
|
|---|
| 5 | VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
|
|---|
| 6 | #else
|
|---|
| 7 | #undef abs
|
|---|
| 8 | #include <math.h>
|
|---|
| 9 | extern double f__cabs(double,double);
|
|---|
| 10 | void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
|
|---|
| 11 | #endif
|
|---|
| 12 | {
|
|---|
| 13 | double logr, logi, x, y;
|
|---|
| 14 |
|
|---|
| 15 | logr = log( f__cabs(a->r, a->i) );
|
|---|
| 16 | logi = atan2(a->i, a->r);
|
|---|
| 17 |
|
|---|
| 18 | x = exp( logr * b->r - logi * b->i );
|
|---|
| 19 | y = logr * b->i + logi * b->r;
|
|---|
| 20 |
|
|---|
| 21 | r->r = x * cos(y);
|
|---|
| 22 | r->i = x * sin(y);
|
|---|
| 23 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.