Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laszlokorte/low-discrepancy-phi
https://github.com/laszlokorte/low-discrepancy-phi
Last synced: about 19 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/laszlokorte/low-discrepancy-phi
- Owner: laszlokorte
- Created: 2024-06-07T16:13:20.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T16:18:11.000Z (5 months ago)
- Last Synced: 2024-06-07T17:49:52.148Z (5 months ago)
- Language: Svelte
- Size: 176 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple sequence of well distributed numbers
![Preview Screenshot](./preview.png)
[Live Demo](https://static.laszlokorte.de/phi-noise/)
This is an showcase of how to generate a Low-discrepancy sequence of numbers by simply sampling a line that has the golden ratio (ϕ=1.61803…) as slope:
r=mod(a+b·n,1) with b = ϕ
You can also try other slopes to observe how the perceived randomness vanishes. Some other numbers than ϕ do also work quite well.
π does not.Using such a sequence of numbers might be useful if you want to generate a new (pseudo) random value from a limited range that is as distinct as possible from all previously generated values.
Say you want to plot multiple data points in distinct colors and new to select a new color for each point but do not know how many data points there will be in advanced.