Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Random.h

00001 /*
00002   File: Random.h
00003 
00004   Copyright(C) C. Kotterink, Computed Graphics
00005 */
00006 #ifndef RANDOM_H
00007 #define RANDOM_H
00008 
00009 #include<Vertex3.h>
00010 
00011 #include<stdlib.h>
00012 
00015 namespace Random
00016 {
00017     void initialize();
00018 
00019     inline int intValue(int max) { return max*rand()/RAND_MAX; }
00020     inline real realValue() { return 1.0-(2.0*rand()/(real)RAND_MAX); }
00021     inline real urealValue() { return (real)rand()/(real)RAND_MAX; }
00022 
00023     //  Returns a normalized random vector
00024     Vertex3 vertex3();
00025 };
00026 #endif

This documentation was generated using doxygen. If you have any comments or additions please mail me.