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