Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.01 KB

real.md

File metadata and controls

65 lines (43 loc) · 1.01 KB

real

Extract the real component from real and complex values.

API

Numeric.complex.real(value)

Reads the real component of each nested entry.

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

Examples

Real part of a real value

import Numeric from '@neabyte/numerix'

const part = Numeric.complex.real(5)

console.log(part)
// 5

Real part of a complex value

import Numeric from '@neabyte/numerix'

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

console.log(part)
// 3

Real parts of a vector

import Numeric from '@neabyte/numerix'

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

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

Real parts of complex values

import Numeric from '@neabyte/numerix'

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

console.log(parts)
// [1,3]