Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including zero-crossings with all npm packages installed. Try it out:

var zeroCrossings = require("zero-crossings")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

zero-crossings v1.0.1

Finds all zero crossings in a 1D ndarray


Finds all zero crossings in a 1D ndarray assuming piecewise-linear interpolation.


var ndarray = require("ndarray")
var zc = require("zero-crossings")

var array = ndarray([1, -1, 0, 10, 3, -1])



[ 0.5, 2, 4.75 ]


npm install zero-crossings



Finds all zero crossings in the 1D ndarray array

  • array is a 1D ndarray
  • level is an optional parameter which indicates the crossings

Returns A list of all zero crossings in array


(c) 2014 Mikola Lysenko. MIT License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free