C++ (Qt)MTRand mtRand; mtRand.seed(time(0)); for (int i = 0; i < m_numPoints; ++i) { double alpha = mtRand.rand(2.0)-1.0; double betta = mtRand.rand(2.0)-1.0; double gamma = mtRand.rand(2.0)-1.0; double norm = sqrt(alpha*alpha + betta*betta + gamma*gamma); alpha /= norm; betta /= norm; gamma /= norm; double z = m_radius*gamma; double x = m_radius*alpha; double y = m_radius*betta; drawPoint(Point3D(x, y, z), &painter, 2); }