<commit_before># phase

> Compute the [argument][complex-number] of a complex number in radians.


<section class="intro">

The [argument][complex-number] of a complex number, also known as the __phase__, is the angle of the radius extending from the origin to the complex number plotted in the complex plane and the positive real axis.

</section>

<!-- /.intro -->


<section class="usage">

## Usage

``` javascript
var cphase = require( '@stdlib/math/base/complex/phase' );
```

#### cphase( re, im )

Computes the [argument][complex-number] of a `complex` number comprised of a __real__ component `re` and an __imaginary__ component `im`.

``` javascript
var phi = cphase( 5.0, 3.0 );
// returns ~0.5404
```

</section>

<!-- /.usage -->


<section class="examples">

## Examples

``` javascript
var Complex128 = require( '@stdlib/types/complex/complex128' );
var randu = require( '@stdlib/math/base/random/randu' );
var round = require( '@stdlib/math/base/special/round' );
var real = require( '@stdlib/types/complex/utils/real' );
var imag = require( '@stdlib/types/complex/utils/imag' );
var cphase = require( '@stdlib/math/base/complex/phase' );

var re;
var im;
var z;
var i;

for ( i = 0; i < 100; i++ ) {
    re = round( randu()*100.0 ) - 50.0;
    im = round( randu()*100.0 ) - 50.0;
    z = new Complex128( re, im );
    console.log( 'arg(%s) = %d', z.toString(), cphase( real(z), imag(z) ) );
}
```

</section>

<!-- /.examples -->


<section class="links">

[complex-number]: https://en.wikipedia.org/wiki/Complex_number<commit_msg>Update link<commit_after># phase

> Compute the [argument][complex-number-argument] of a complex number in radians.


<section class="intro">

The [argument][complex-number-argument] of a complex number, also known as the __phase__, is the angle of the radius extending from the origin to the complex number plotted in the complex plane and the positive real axis.

</section>

<!-- /.intro -->


<section class="usage">

## Usage

``` javascript
var cphase = require( '@stdlib/math/base/complex/phase' );
```

#### cphase( re, im )

Computes the [argument][complex-number-argument] of a `complex` number comprised of a __real__ component `re` and an __imaginary__ component `im`.

``` javascript
var phi = cphase( 5.0, 3.0 );
// returns ~0.5404
```

</section>

<!-- /.usage -->


<section class="examples">

## Examples

``` javascript
var Complex128 = require( '@stdlib/types/complex/complex128' );
var randu = require( '@stdlib/math/base/random/randu' );
var round = require( '@stdlib/math/base/special/round' );
var real = require( '@stdlib/types/complex/utils/real' );
var imag = require( '@stdlib/types/complex/utils/imag' );
var cphase = require( '@stdlib/math/base/complex/phase' );

var re;
var im;
var z;
var i;

for ( i = 0; i < 100; i++ ) {
    re = round( randu()*100.0 ) - 50.0;
    im = round( randu()*100.0 ) - 50.0;
    z = new Complex128( re, im );
    console.log( 'arg(%s) = %d', z.toString(), cphase( real(z), imag(z) ) );
}
```

</section>

<!-- /.examples -->


<section class="links">

[complex-number-argument]: https://en.wikipedia.org/wiki/Argument_%28complex_analysis%29
{'fraction_non_alphanumeric': 0.1773117254528122, 'fraction_numerical': 0.024149984111852558, 'mean_word_length': 3.8282208588957056, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6437407', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1035, 'n_words': 314}