2.1.16.2.1 cabs


Description

returns the amplitude (modulus) of the complex value.

Syntax

double cabs( complex z )

Parameters

z
[input] the complex value whose amplitude is sought.

Return

The amplitude

Examples

EX1

void    run_complex_cabs()
{
    complex        cc(1., -1.);
    
    // Display the amplitude:
    out_double("amplitude = ", cabs(cc));    // shoulde be 1.41421 (=sqrt(2))
}

Remark

See Also

Header to Include

origin.h

Reference