Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

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 "mathh.h"
00009 extern double f__cabs(double,double);
00010 void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
00011 #endif
00012 {
00013 double logr, logi, x, y;
00014 
00015 logr = log( f__cabs(a->r, a->i) );
00016 logi = atan2(a->i, a->r);
00017 
00018 x = exp( logr * b->r - logi * b->i );
00019 y = logr * b->i + logi * b->r;
00020 
00021 r->r = x * cos(y);
00022 r->i = x * sin(y);
00023 }
 

Powered by Plone

This site conforms to the following standards: