In a Monte Carlo simulation i have encountered the following problem: given a unity vector u defining a point A on the surface of a unity sphere, i must randomly determine a new vector forming an angle θ in [0,max) with the initial vector. In other words, i need an algorithm that randomly chooses, out of a uniform distribution, a point on the surface of the sphere inside a circle on the sphere with predefined radius centered at the initial point A.
I was thinking of making a coordinates rotation from (x,y,z) to (X,Y,Z) using Euler angles (θ,Ψ,φ), such that Z=u. Then, a transformation from Cartesian coordinates to spherical coordinates (r,θ,φ) where u=(1,0,0) and uniformly choose cosθ and φ. Last, make the transformation to (X,Y,Z) and then to (x,y,z). But, trigonometric functions are too slow, is there any faster way?
Could Marsaglia method for uniformly distributed points on the surface of a sphere be modified so as to choose points in the vicinity of a point?
Thanks in advance for any suggestions.