function p = sample_s2 z = 2*(rand-0.5); t = rand * 2 * pi; x = sqrt(1-z^2) * cos(t); y = sqrt(1-z^2) * sin(t); p = [x;y;z];