Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for the reply.

I came up with:

f(x) = (sin((pi * x) - (pi / 2)) + 1) / 2 where x is between 0 and 1

I'm a collector of randomness functions for games. Weighted, gaussian, linear, etc. This sinusoidal randomness will be handy! Thanks for the inspiration.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: