Skip to content

scijs/sphere-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sample a random point on a hypersphere

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published