source:
GTP/trunk/App/Demos/Illum/Hierarchical Systems Demo [OpenGL]/RESOURCES/include/random.cpp
@
852
Revision 852, 275 bytes checked in by szirmay, 18 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[852] | 1 | #include "random.h" |
2 | ||
3 | double UnitRandom () | |
4 | { | |
5 | return ((double)rand()) / RAND_MAX; | |
6 | } | |
7 | ||
8 | double RangeRandom (double fLow, double fHigh) | |
9 | { | |
10 | return (fHigh-fLow)*UnitRandom() + fLow; | |
11 | } | |
12 | ||
13 | double SymmetricRandom () | |
14 | { | |
15 | return 2.0f * UnitRandom() - 1.0f; | |
16 | } |
Note: See TracBrowser
for help on using the repository browser.