pyrex.generation.RectangularGenerator.get_direction¶
-
RectangularGenerator.
get_direction
()¶ Get the direction of the next particle to be generated.
Randomly generates a cartesian unit vector uniformly distributed over the unit sphere.
- Returns
- ndarray
(Unit) vector direction.
Notes
Generates random vector direction by pulling from uniform distributions for -1<cos(theta)<1 and 0<phi<2*pi.