Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.06 KB

mesh.md

File metadata and controls

54 lines (36 loc) · 1.06 KB

mesh

Build a coordinate grid from two axes of values.

API

Numeric.create.mesh(vertical, columns, indexing = 'xy')

Builds coordinate arrays for each grid axis.

  • Parameters:
    • vertical: Coordinates along the first axis
    • columns: Coordinates along the second axis
    • indexing: Indexing order of the returned grid
    • sparse: When true returns sparse coordinate grids
  • Returns: Grid of coordinate arrays
  • NumPy: Covers np.meshgrid, np.indices, np.ix_ through a single Numerix method.

Examples

Grid from two coordinate axes

import Numeric from '@neabyte/numerix'

const grid = Numeric.create.mesh([1, 2], [3, 4])

console.log(grid)
// [[[1,2],[1,2]],[[3,3],[4,4]]]

Grid with matrix indexing order

import Numeric from '@neabyte/numerix'

const grid = Numeric.create.mesh([1, 2], [3, 4], 'ij')

console.log(grid)
// [[[1,1],[2,2]],[[3,4],[3,4]]]

Grid from a single axis

import Numeric from '@neabyte/numerix'

const grid = Numeric.create.mesh([1, 2, 3])

console.log(grid)
// [[[0,0]],[[0,1]]]