simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

arg.md (1071B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function arg
      4 
      5 Compute the argument of a complex value.
      6 For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.
      7 
      8 For matrices, the function is evaluated element wise.
      9 
     10 
     11 ## Syntax
     12 
     13 ```js
     14 math.arg(x)
     15 ```
     16 
     17 ### Parameters
     18 
     19 Parameter | Type | Description
     20 --------- | ---- | -----------
     21 `x` | number &#124; BigNumber &#124; Complex &#124; Array &#124; Matrix |  A complex number or array with complex numbers
     22 
     23 ### Returns
     24 
     25 Type | Description
     26 ---- | -----------
     27 number &#124; BigNumber &#124; Array &#124; Matrix | The argument of x
     28 
     29 
     30 ### Throws
     31 
     32 Type | Description
     33 ---- | -----------
     34 
     35 
     36 ## Examples
     37 
     38 ```js
     39 const a = math.complex(2, 2)
     40 math.arg(a) / math.pi          // returns number 0.25
     41 
     42 const b = math.complex('2 + 3i')
     43 math.arg(b)                    // returns number 0.982793723247329
     44 math.atan2(3, 2)               // returns number 0.982793723247329
     45 ```
     46 
     47 
     48 ## See also
     49 
     50 [re](re.md),
     51 [im](im.md),
     52 [conj](conj.md),
     53 [abs](abs.md)