pow_zz.c
Go to the documentation of this file.
00001 #include "f2c.h"
00002 
00003 #ifdef KR_headers
00004 double log(), exp(), cos(), sin(), atan2(), f__cabs();
00005 VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
00006 #else
00007 #undef abs
00008 #include "math.h"
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012 extern double f__cabs(double,double);
00013 void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
00014 #endif
00015 {
00016 double logr, logi, x, y;
00017 
00018 logr = log( f__cabs(a->r, a->i) );
00019 logi = atan2(a->i, a->r);
00020 
00021 x = exp( logr * b->r - logi * b->i );
00022 y = logr * b->i + logi * b->r;
00023 
00024 r->r = x * cos(y);
00025 r->i = x * sin(y);
00026 }
00027 #ifdef __cplusplus
00028 }
00029 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:56