Socket
Book a DemoInstallSign in
Socket

sphere-random

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sphere-random

Uniformmly sample a point on a hypersphere

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

sphere-random

Generates a random point on a sphere.

Example

var sphereRandom = require('sphere-random')

for(var i=1; i<5; ++i) {
  console.log(sphereRandom(i))
}

Install

npm install sphere-random

API

require('sphere-random')(d)

Generates a random point on the surface of a d-dimensional hypersphere

  • d is the dimension of the sphere to sample

Returns A point on the surface of a d-dimensional sphere

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

sphere

FAQs

Package last updated on 28 Nov 2014

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