ndarray-linear-interpolate

WebJar for ndarray-linear-interpolate

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ndarray-linear-interpolate
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ndarray-linear-interpolate
WebJar for ndarray-linear-interpolate
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/scijs/ndarray-linear-interpolate

Download ndarray-linear-interpolate

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ndarray-linear-interpolate/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ndarray-linear-interpolate</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ndarray-linear-interpolate/
implementation 'org.webjars.npm:ndarray-linear-interpolate:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/ndarray-linear-interpolate/
implementation ("org.webjars.npm:ndarray-linear-interpolate:1.0.0")
'org.webjars.npm:ndarray-linear-interpolate:jar:1.0.0'
<dependency org="org.webjars.npm" name="ndarray-linear-interpolate" rev="1.0.0">
  <artifact name="ndarray-linear-interpolate" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ndarray-linear-interpolate', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "ndarray-linear-interpolate" % "1.0.0"
[org.webjars.npm/ndarray-linear-interpolate "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

ndarray-linear-interpolate

Multilinear (ie bilinear/trilinear) interpolation for ndarrays.

Example

var ndarray = require("ndarray")
var interp = require("ndarray-linear-interpolate")

var x = ndarray(new Float32Array(9), [3, 3])
x.set(1, 1, 1.0)

for(var u=0.0, u<=3.0; u+=0.25) {
  var row = []
  for(var v=0.0; v<=3.0; v+=0.25) {
    row.push(interp(x, u, v))
  }
  console.log(row.join(" "))
}

//Prints out:
//
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//    0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0
//    0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0
//    0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0
//    0 0.25 0.5 0.75 1 0.75 0.5 0.25 0 0 0 0 0
//    0 0.1875 0.375 0.5625 0.75 0.5625 0.375 0.1875 0 0 0 0 0
//    0 0.125 0.25 0.375 0.5 0.375 0.25 0.125 0 0 0 0 0
//    0 0.0625 0.125 0.1875 0.25 0.1875 0.125 0.0625 0 0 0 0 0
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//    0 0 0 0 0 0 0 0 0 0 0 0 0
//

Install

npm install ndarray-linear-interpolate

require("ndarray-linear-interpolate")(array, x, y, z, ...)

Interpolates values on an ndarray.

  • array the array to interpolate from
  • x, y, z... the coordinate to evaluate the interpolated grid at

Returns The multilinearly interpolated value

Note To avoid the overhead of variable arguments, special interfaces are available for 1, 2 and 3 dimensions. You can access these using:

  • require("ndarray-linear-interpolate").d1
  • require("ndarray-linear-interpolate").d2
  • require("ndarray-linear-interpolate").d3

Credits

(c) 2013 Mikola Lysenko. MIT License

org.webjars.npm

Versions

Version
1.0.0