defmech / random-position-on-the-surface-of-a-sphere

Sometimes you just need to postion things on the surface of a sphere. Here are a few methods I've used over the years.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random Position On The Surface Of A Sphere

Sometimes you just need to postion things on the surface of a sphere. Here are a few methods I've used over the years.

Blog post coming soon.

getCartesianPositions(100000, 50) Note the vertical clustering. 😬 getCartesianPositions(100000, 50) getSphericalPositions(100000, 50) Note the clustering at the poles. 😠 getSphericalPositions(100000, 50) getSphericalPositionsWithBias(100000, 50, 1) Clustering at the equator! 😢 getSphericalPositionsWithBias(100000, 50, 1) getSphericalPositionsWithBias(100000, 50, 0.5) 🙂 getSphericalPositionsWithBias(100000, 50, 0.5) getUniformPositions(10000, 50) getUniformPositions(10000, 50)

About

Sometimes you just need to postion things on the surface of a sphere. Here are a few methods I've used over the years.

License:MIT License


Languages

Language:JavaScript 98.5%Language:HTML 1.5%