Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/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.
https://github.com/defmech/random-position-on-the-surface-of-a-sphere
javascript three-js trigonometry
Last synced: 3 months ago
JSON representation
Sometimes you just need to postion things on the surface of a sphere. Here are a few methods I've used over the years.
- Host: GitHub
- URL: https://github.com/defmech/random-position-on-the-surface-of-a-sphere
- Owner: defmech
- License: mit
- Created: 2017-10-12T10:49:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T13:12:58.000Z (about 7 years ago)
- Last Synced: 2024-07-18T16:33:07.345Z (4 months ago)
- Topics: javascript, three-js, trigonometry
- Language: JavaScript
- Size: 1.43 MB
- Stars: 22
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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)](screenshots/Vec3.png?raw=true)
getSphericalPositions(100000, 50) Note the clustering at the poles. 😠![getSphericalPositions(100000, 50)](screenshots/Spherical.png?raw=true)
getSphericalPositionsWithBias(100000, 50, 1) Clustering at the equator! 😢 ![getSphericalPositionsWithBias(100000, 50, 1)](screenshots/Spherical%20Bias%201.png?raw=true)
getSphericalPositionsWithBias(100000, 50, 0.5) 🙂 ![getSphericalPositionsWithBias(100000, 50, 0.5)](screenshots/Spherical%20bias%200.5.png?raw=true)
getUniformPositions(10000, 50) ![getUniformPositions(10000, 50)](screenshots/Uniform.png?raw=true)