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 File Reference

#include "f2c.h"
#include "mathh.h"

Go to the source code of this file.


Functions

double f__cabs (double, double)
void pow_zz (doublecomplex *r, doublecomplex *a, doublecomplex *b)

Function Documentation

double f__cabs double   ,
double   
 

Definition at line 7 of file cabs.c.

00009 {
00010 double temp;
00011 
00012 if(real < 0)
00013         real = -real;
00014 if(imag < 0)
00015         imag = -imag;
00016 if(imag > real){
00017         temp = real;
00018         real = imag;
00019         imag = temp;
00020 }
00021 if((real+imag) == real)
00022         return(real);
00023 
00024 temp = imag/real;
00025 temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
00026 return(temp);
00027 }

void pow_zz doublecomplex   r,
doublecomplex   a,
doublecomplex   b
 

Definition at line 10 of file pow_zz.c.

References a, f__cabs(), and r.

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: