I\'m working on a data mining algorithm where i want to pick a random direction from a particular point in the feature space.
If I pick a random number for each of
#define SCL1 (M_SQRT2/2) #define SCL2 (M_SQRT2*2) // unitrand in [-1,1]. double u = SCL1 * unitrand(); double v = SCL1 * unitrand(); double w = SCL2 * sqrt(1.0 - u*u - v*v); double x = w * u; double y = w * v; double z = 1.0 - 2.0 * (u*u + v*v);