Routine ID: G901 | |
---|---|
Author(s): H. Lipps | Library: KERNLIB |
Submitter: | Submitted: 01.09.1983 |
Language: Fortran | Revised: 24.06.1985 |
OBSOLETE
Please note that this routine has been obsoleted in CNL 215. Users are
advised not to use it any longer and to replace it in older programs.
No maintenance for it will take place and it will eventually disappear.
Suggested replacement: RAN3D (V130)
These subroutines generate random points uniformly distributed on the circumference of a circle ( RAN2VS and VRAN2S) or on the surface of a sphere ( RAN3VS and VRAN3S); i.e., 2- or 3-dimensional random vectors of specified length.
Structure:
SUBROUTINE subprograms
User Entry Names: RAN2VS, RAN3VS, VRAN2S,
VRAN3S
External References: RANF (G900)
Usage:
CALL RAN2VS(RADIUS,X,Y) CALL RAN3VS(RADIUS,X,Y,Z) CALL VRAN2S(RADIUS,N,X,Y,R) CALL VRAN3S(RADIUS,N,X,Y,Z,R)
Method:
RAN2VS initially computes a random point uniformly distributed over the interior of the square , using two calls to RANF (G900). If this point lies outside the unit circle it is discarded and the process is repeated until a point lying inside the unit circle is found. The output point (X,Y) is then the projection of ( ) from the origin onto the circumference of the specified circle.
RAN3VS proceeds similary, using a cube instead of a square.
VRAN2S and VRAN3S apply the same method to generate N points at each call.
These subroutines are based on a similar subroutine RAN3D (V130)
written by F. James.
Operation Research Techniques and Management Science