add env script
[bpt/guile.git] / module / slib / randinex.txi
1
2 @defun random:uniform
3
4
5 @defunx random:uniform state
6 Returns an uniformly distributed inexact real random number in the
7 range between 0 and 1.
8 @end defun
9
10 @defun random:exp
11
12
13 @defunx random:exp state
14 Returns an inexact real in an exponential distribution with mean 1. For
15 an exponential distribution with mean @var{u} use
16 @w{@code{(* @var{u} (random:exp))}}.
17 @end defun
18
19 @defun random:normal
20
21
22 @defunx random:normal state
23 Returns an inexact real in a normal distribution with mean 0 and
24 standard deviation 1. For a normal distribution with mean @var{m} and
25 standard deviation @var{d} use
26 @w{@code{(+ @var{m} (* @var{d} (random:normal)))}}.
27 @end defun
28
29 @defun random:normal-vector! vect
30
31
32 @defunx random:normal-vector! vect state
33 Fills @var{vect} with inexact real random numbers which are independent
34 and standard normally distributed (i.e., with mean 0 and variance 1).
35 @end defun
36
37 @defun random:hollow-sphere! vect
38
39
40 @defunx random:hollow-sphere! vect state
41 Fills @var{vect} with inexact real random numbers the sum of whose
42 squares is equal to 1.0. Thinking of @var{vect} as coordinates in space
43 of dimension n = @code{(vector-length @var{vect})}, the coordinates are
44 uniformly distributed over the surface of the unit n-shere.
45 @end defun
46
47 @defun random:solid-sphere! vect
48
49
50 @defunx random:solid-sphere! vect state
51 Fills @var{vect} with inexact real random numbers the sum of whose
52 squares is less than 1.0. Thinking of @var{vect} as coordinates in
53 space of dimension @var{n} = @code{(vector-length @var{vect})}, the
54 coordinates are uniformly distributed within the unit @var{n}-shere.
55 The sum of the squares of the numbers is returned.
56 @end defun