17 INLINE LVector3 LinearRandomForce::
18 random_unit_vector() {
19 PN_stdfloat z, r, theta;
21 z = 1.0 - (2.0 * bounded_rand());
22 r = csqrt(1.0 - (z * z));
23 theta = 2.0 * MathNumbers::pi * bounded_rand();
25 return LVector3(r * ccos(theta), r * csin(theta), z);