Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.02 KB

imag.md

File metadata and controls

65 lines (43 loc) · 1.02 KB

imag

Extract the imaginary component from real and complex values.

API

Numeric.complex.imag(value)

Reads the imaginary component of each nested entry.

  • Parameters:
    • value: Complex or real values to inspect
  • Returns: Imaginary parts matching the input nesting shape
  • NumPy: Covers np.imag, ndarray.imag through a single Numerix method.

Examples

Imaginary part of a real value

import Numeric from '@neabyte/numerix'

const part = Numeric.complex.imag(5)

console.log(part)
// 0

Imaginary part of a complex value

import Numeric from '@neabyte/numerix'

const part = Numeric.complex.imag({ re: 3, im: 4 })

console.log(part)
// 4

Imaginary parts of a vector

import Numeric from '@neabyte/numerix'

const parts = Numeric.complex.imag([1, 2])

console.log(parts)
// [0,0]

Imaginary parts of complex values

import Numeric from '@neabyte/numerix'

const parts = Numeric.complex.imag([
  { re: 1, im: 2 },
  { re: 3, im: 4 }
])

console.log(parts)
// [2,4]