.TH "lib/cplex/cpow.c" 3 "Tue Jan 24 2017" "Version 1.6.2" "amath" \" -*- nroff -*- .ad l .nh .SH NAME lib/cplex/cpow.c \- .SH SYNOPSIS .br .PP \fC#include 'prim\&.h'\fP .br \fC#include 'math\&.h'\fP .br \fC#include 'complex\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "\fBcomplex\fP \fBcpow\fP (\fBcomplex\fP a, \fBcomplex\fP z)" .br .RI "\fIComplex number raised to a power\&. \fP" .in -1c .SH "Function Documentation" .PP .SS "\fBcomplex\fP cpow (\fBcomplex\fP a, \fBcomplex\fP z)" .PP Complex number raised to a power\&. .PP \fBVersion:\fP .RS 4 1\&.1 .RE .PP \fBDate:\fP .RS 4 2007/08/20 .RE .PP .PP Definition at line 46 of file cpow\&.c\&. .PP References atan2(), cabs(), cimag(), cos(), cpack(), creal(), exp(), pow(), and sin()\&. .PP Referenced by ComplexNumber::Raise()\&. .PP .nf 47 { 48 complex w; 49 double x, y, r, theta, absa, arga; 50 51 x = creal(z); 52 y = cimag(z); 53 absa = cabs(a); 54 if (absa == 0\&.0) { 55 return cpack(0\&.0, + 0\&.0); 56 } 57 arga = atan2(cimag(a), creal(a)); 58 59 r = pow(absa, x); 60 theta = x * arga; 61 if (y != 0\&.0) { 62 r = r * exp(-y * arga); 63 theta = theta + y * log(absa); 64 } 65 66 w = cpack(r * cos(theta), r * sin(theta)); 67 return w; 68 } .fi .SH "Author" .PP Generated automatically by Doxygen for amath from the source code\&.