2.1.16.2.5 rpow


Description

returns the power of the complex value such that the power is a double value

Syntax

complex rpow( complex z, double x )

Parameters

z
[input] the complex value whose power is sought.
x
[input] the power

Return

z^x

Examples

EX1

void    run_complex_rpow()
{
    complex            cc(sqrt(3.), 1.);    // the complex number whose real part
                                        // is the square root of 3, and imaginary part is 1.
                                        // so that its phase is 30 degrees and amplitude is 2.
    double            x = 3.;
    
    complex            cresult = rpow(cc, x);
    
    out_complex("Input = ", cc);
    out_double("power = ", x);
    out_complex("rpow = ", cresult);    // the result should be such that its amplitude is 8 (which
                                        // is 2 to the power 3.) and whose phase is 90 degrees (which
                                        // is 30 degrees times 3.).
                                        // so "rpow = -0.000000+8.000000i"
}

Remark

See Also

cpow

Header to Include

origin.h

Reference