New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simplex-noise

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplex-noise

simplex-noise is a fast simplex noise implementation in Javascript.

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
decreased by-19.15%
Maintainers
1
Weekly downloads
 
Created
Source

simplex-noise.js

simplex-noise.js is a fast simplex noise implementation in Javascript. It works in the browser and on nodejs.

Requirements

It requires typed arrays, if you want to use it in browsers without support you will need to use a polyfill like typedarray.js.

Demo

Simple 2D plasma demo on jsfiddle.net.

Usage

// initializing a simplex instance
// do this only once it's relatively expensive
var simplex = new SimplexNoise(),
    value2d = simplex.noise2D(x, y),
    value3d = simplex.noise3D(x, y, z),
    value4d = simplex.noise2D(x, y, z, w);

You can also pass an alternative random function to the constructor that is used to build the permutation table:

var simplex = new SimplexNoise(Math.random),
    value2d = simplex.noise2D(x, y);

node.js

Node.js is also supported, you can install the package using npm.

var SimplexNoise = require('simplex-noise'),
    simplex = new SimplexNoise(Math.random),
    value2d = simplex.noise2D(x, y);

Benchmarks

Tests

There are some simple buster.js tests for this library to run them first install buster.js and jshint:

npm install buster.js
# if you haven't done so already
npm install -g jshint
make tests

Changelog

2.1.1

  • Increased entropy by fixing a little initialization issue.

2.1.0

  • AMD support

2.0.0

  • Changed node.js api, SimplexNoise is now exported directly.
  • Added unit tests

1.0.0

  • Initial Release

Credits

This is mostly a direct javascript port of the Java implementation by Stefan Gustavson and Peter Eastman.

FAQs

Package last updated on 14 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc