Generating a random displacement on the unit sphere
- by becko
Given a unit vector n, I need to generate, as fast as possible, another random unit vector m. The deviation of m from n should be on the order of a positive parameter sigma, and the distribution of m on the unit sphere should be symmetrical around n.
I have no specific requirements on the representation of unit vectors, so you can use spherical angles, Cartesian coordinates, or whatever turns out to be convenient. Also, there are no precise requirements on the probability distributions used, as long as it decays when m deviates more than sigma from n.
I am working with gsl and C. I have come up with a somewhat convoluted method using Cartesian coordinates. I will post it later if it is useful, but I would like to see people's ideas.