From: <de...@us...> - 2003-01-11 10:58:15
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv24183 Modified Files: TypesMath.cpp Log Message: no message Index: TypesMath.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/TypesMath.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypesMath.cpp 5 Dec 2002 03:23:31 -0000 1.2 --- TypesMath.cpp 11 Jan 2003 10:58:12 -0000 1.3 *************** *** 47,49 **** --- 47,63 ---- else return atan( p_b / p_a ); + } + + float UnsignedRandomNumber() + // returns a random number in [0,1] + { + float fnum = static_cast<float>(rand())/RAND_MAX; + return fnum; + } + + float SignedRandomNumber() + // returns a random number in [0,1] + { + float fnum = 2.0 * UnsignedRandomNumber() - 1.0; + return fnum; } |