<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_random__numbers_8h">
<title>/Users/bernard/b20/bsoft/include/random_numbers.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/random_numbers.h</primary></indexterm>
<para>

<para>Header file for functions for creating random images. </para>
 
</para>
<programlisting>#include &lt;Vector3.h&gt;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>long <link linkend="_random__numbers_8h_1a4be2e3f9c9093e116c0c2651ff5749da">get_rand_max</link> ()</para>

<para>Finds the maximum random number for a system. </para>
</listitem>
            <listitem><para>long <link linkend="_random__numbers_8h_1aaf6782d7d2517fee0da4dd2f44cee916">random_seed</link> ()</para>

<para>Gets a random seed and sets the flag. </para>
</listitem>
            <listitem><para>float * <link linkend="_random__numbers_8h_1abd163fa746f8e03d997bcaca4eae4d8e">random_array_uniform</link> (long n, double min, double max)</para>

<para>Generates a series with a uniform random distribution. </para>
</listitem>
            <listitem><para>double <link linkend="_random__numbers_8h_1a148d31197cd7006695f2696429a07c2b">random_gaussian</link> (double avg, double std)</para>

<para>Generates a value with a gaussian random distribution. </para>
</listitem>
            <listitem><para>float * <link linkend="_random__numbers_8h_1a19d4a84277d166aab806943d9430ad9c">random_array_gaussian</link> (long n, double avg, double std)</para>

<para>Generates a series with a gaussian random distribution of values. </para>
</listitem>
            <listitem><para>double <link linkend="_random__numbers_8h_1a77c45214248aeb6f013ddbe792d2e139">random_poisson</link> (double avg)</para>

<para>Generates a value deviating from the average based on a poisson distribution. </para>
</listitem>
            <listitem><para>float * <link linkend="_random__numbers_8h_1a734ae681ba8deb60037b9c520e054c63">random_array_poisson</link> (int n, double avg)</para>

<para>Generates a series with a poisson random distribution of values. </para>
</listitem>
            <listitem><para>double <link linkend="_random__numbers_8h_1ac32b9dcba380c556d5a83336b7e3c352">random_logistical</link> (double avg, double std)</para>

<para>Generates a value with a logistical random distribution. </para>
</listitem>
            <listitem><para>float * <link linkend="_random__numbers_8h_1ab57c386f0bd64ed0cabaaee59fd43543">random_array_logistical</link> (long n, double avg, double std)</para>

<para>Generates an array with a logistical random distribution. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a944ac1e3e0632768167b64e3d70933c0">vector3_random_unit_sphere</link> ()</para>

<para>Generates a random vector on the unit sphere. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a87233a943e70c6b7cdc24eda68b69d4c">vector3_random</link> (const double min, const double max)</para>

<para>Generates a random vector within a defined cube. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a974b1c766cb921fe55bf2a919f7e5516">vector3_random</link> (<link linkend="_class_vector3">Vector3</link>&lt; double &gt; min, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; max)</para>

<para>Generates a random vector within a defined cube. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a3a44ab11c2e0bfc54593b96bd3e7bac1">vector3_random</link> (const double <link linkend="__vector3_8h_1a7baf5ed670fcf9bcca9a3a400820e292">length</link>)</para>

<para>Generates a random vector within a defined sphere. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a67feb4976609269c62290aea410d2f79">vector3_random_gaussian</link> (double avg, double std)</para>

<para>Generates a random vector within a random gaussian-distributed length. </para>
</listitem>
            <listitem><para><link linkend="_class_vector3">Vector3</link>&lt; double &gt; <link linkend="_random__numbers_8h_1a6cb6986b2b1763e3e8139621744e635b">vector3_xy_random_gaussian</link> (double avg, double std)</para>

<para>Generates a random vector within a random gaussian-distributed length in the xy plane. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Header file for functions for creating random images. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 19990703 </para>

<para>Modified: 20151113 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_random__numbers_8h_1a4be2e3f9c9093e116c0c2651ff5749da"/>    <section>
    <title>get_rand_max()</title>
<indexterm><primary>get_rand_max</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>get_rand_max</secondary></indexterm>
<para><computeroutput>long get_rand_max ( )</computeroutput></para><para>

<para>Finds the maximum random number for a system. </para>
</para>

<para><formalpara><title>Returns: </title>

<para>long the maximum random number. <literallayout><computeroutput>Loops through random numbers to determine if the maximum is 2 or 4 bytes.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 22 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a19d4a84277d166aab806943d9430ad9c"/>    <section>
    <title>random_array_gaussian()</title>
<indexterm><primary>random_array_gaussian</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_array_gaussian</secondary></indexterm>
<para><computeroutput>float* random_array_gaussian (long n, double avg, double stdev)</computeroutput></para><para>

<para>Generates a series with a gaussian random distribution of values. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>n</entry>
                                <entry>
<para>number of values. </para>
</entry>
                            </row>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>float* the array of values. <literallayout><computeroutput>An array of floating point numbers is generated with a gaussian 
distribution with a given average and standard deviation:
    value = average + std_dev*sqrt(-2*log(random_value))*
                    cos(2*PI*random_value);
where random_value is between 0 and 1.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 172 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1ab57c386f0bd64ed0cabaaee59fd43543"/>    <section>
    <title>random_array_logistical()</title>
<indexterm><primary>random_array_logistical</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_array_logistical</secondary></indexterm>
<para><computeroutput>float* random_array_logistical (long n, double avg, double stdev)</computeroutput></para><para>

<para>Generates an array with a logistical random distribution. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>n</entry>
                                <entry>
<para>number of values. </para>
</entry>
                            </row>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>float* array of values. <literallayout><computeroutput>An array of floating point numbers is generated with a logistical 
differential distribution with a given average and standard deviation:
    value = average + (std_dev/golden)*ln(1/random_value - 1)
where random_value is between 0 and 1 and:
    golden  = (sqrt(5) + 1)/2
</computeroutput></literallayout> Reference: Press W.H. et al (1992) Numerical Recipes in C. </para>
</formalpara>
</para>
<para>
Definition at line 379 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a734ae681ba8deb60037b9c520e054c63"/>    <section>
    <title>random_array_poisson()</title>
<indexterm><primary>random_array_poisson</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_array_poisson</secondary></indexterm>
<para><computeroutput>float* random_array_poisson (int n, double avg)</computeroutput></para><para>

<para>Generates a series with a poisson random distribution of values. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>n</entry>
                                <entry>
<para>number of values. </para>
</entry>
                            </row>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>float* the array of values. <literallayout><computeroutput>The poisson distribution is given for j = 0,1,... by:
            avg^j * exp(-avg)
    P(j) = -----------------
                   j!
Note that only positive integer values are defined for j and sum(P(j)) = 1.
An array of floating point numbers is generated with a poisson 
distribution with a given average. The standard deviation is:
    std = sqrt(avg)
If the average &lt;= 0, the return array contains only zeroes.
</computeroutput></literallayout> Reference: Press W.H. et al (1992) Numerical Recipes in C. </para>
</formalpara>
</para>
<para>
Definition at line 296 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1abd163fa746f8e03d997bcaca4eae4d8e"/>    <section>
    <title>random_array_uniform()</title>
<indexterm><primary>random_array_uniform</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_array_uniform</secondary></indexterm>
<para><computeroutput>float* random_array_uniform (long n, double min, double max)</computeroutput></para><para>

<para>Generates a series with a uniform random distribution. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>n</entry>
                                <entry>
<para>number of values. </para>
</entry>
                            </row>
                            <row>
                                <entry>min</entry>
                                <entry>
<para>minimum value. </para>
</entry>
                            </row>
                            <row>
                                <entry>max</entry>
                                <entry>
<para>maximum value. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>float* array with uniform random numbers. <literallayout><computeroutput>An array of floating point numbers is generated distributed uniformly 
in the range of the given minimum and maximum:
    value = random_value*(max - min) + min
where random_value is between 0 and 1.
The average and standard deviation are:
    average = (max + min)/2
    standard deviation = 0.5*sqrt(1/3)*(max - min).
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 76 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a148d31197cd7006695f2696429a07c2b"/>    <section>
    <title>random_gaussian()</title>
<indexterm><primary>random_gaussian</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_gaussian</secondary></indexterm>
<para><computeroutput>double random_gaussian (double avg, double stdev)</computeroutput></para><para>

<para>Generates a value with a gaussian random distribution. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double the random value. <literallayout><computeroutput>A floating point number is generated with a gaussian 
distribution with a given average and standard deviation:
    value = average + std_dev*sqrt(-2*log(random_value))*
                    cos(2*PI*random_value);
where random_value is between 0 and 1.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 123 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1ac32b9dcba380c556d5a83336b7e3c352"/>    <section>
    <title>random_logistical()</title>
<indexterm><primary>random_logistical</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_logistical</secondary></indexterm>
<para><computeroutput>double random_logistical (double avg, double stdev)</computeroutput></para><para>

<para>Generates a value with a logistical random distribution. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double the random value. <literallayout><computeroutput>A floating point number is generated with a logistical 
differential distribution with a given average and standard deviation:
    value = average + (std_dev/golden)*ln(1/random_value - 1)
where random_value is between 0 and 1 and:
    golden  = (sqrt(5) + 1)/2
</computeroutput></literallayout> Reference: Press W.H. et al (1992) Numerical Recipes in C. </para>
</formalpara>
</para>
<para>
Definition at line 338 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a77c45214248aeb6f013ddbe792d2e139"/>    <section>
    <title>random_poisson()</title>
<indexterm><primary>random_poisson</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_poisson</secondary></indexterm>
<para><computeroutput>double random_poisson (double avg)</computeroutput></para><para>

<para>Generates a value deviating from the average based on a poisson distribution. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double value. <literallayout><computeroutput>The poisson distribution is given for j = 0,1,... by:
            avg^j * exp(-avg)
    P(j) = -----------------
                   j!
Note that only positive integer values are defined for j and sum(P(j)) = 1.
A value is generated with a poisson distribution with a given average.
If the average &lt;= 0, the return value is zero.
</computeroutput></literallayout> Reference: Press W.H. et al (1992) Numerical Recipes in C. </para>
</formalpara>
</para>
<para>
Definition at line 221 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1aaf6782d7d2517fee0da4dd2f44cee916"/>    <section>
    <title>random_seed()</title>
<indexterm><primary>random_seed</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>random_seed</secondary></indexterm>
<para><computeroutput>long random_seed ( )</computeroutput></para><para>

<para>Gets a random seed and sets the flag. </para>
</para>

<para><formalpara><title>Returns: </title>

<para>int flag. <literallayout><computeroutput>The random seed is obtained using the program pid.
A flag is set to prevent the seed from being generated multiple times.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 41 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a87233a943e70c6b7cdc24eda68b69d4c"/>    <section>
    <title>vector3_random()<computeroutput>[1/3]</computeroutput></title>
<indexterm><primary>vector3_random</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_random</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_random (const double min, const double max)</computeroutput></para><para>

<para>Generates a random vector within a defined cube. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>min</entry>
                                <entry>
<para>minimum. </para>
</entry>
                            </row>
                            <row>
                                <entry>max</entry>
                                <entry>
<para>maximum. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>Each vector element is set to a random value between the given minimum and maximum.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 440 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a974b1c766cb921fe55bf2a919f7e5516"/>    <section>
    <title>vector3_random()<computeroutput>[2/3]</computeroutput></title>
<indexterm><primary>vector3_random</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_random</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_random (<link linkend="_class_vector3">Vector3</link>&lt; double &gt; min, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; max)</computeroutput></para><para>

<para>Generates a random vector within a defined cube. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>min</entry>
                                <entry>
<para>minimum vector. </para>
</entry>
                            </row>
                            <row>
                                <entry>max</entry>
                                <entry>
<para>maximum vector. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>Each vector element is set to a random value between the given 
minimum and maximum vectors.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 462 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a3a44ab11c2e0bfc54593b96bd3e7bac1"/>    <section>
    <title>vector3_random()<computeroutput>[3/3]</computeroutput></title>
<indexterm><primary>vector3_random</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_random</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_random (const double length)</computeroutput></para><para>

<para>Generates a random vector within a defined sphere. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>length</entry>
                                <entry>
<para>maximum vector length. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>A random vector is generated, normalized and multiplied with
a random value smaller than the given length.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 483 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a67feb4976609269c62290aea410d2f79"/>    <section>
    <title>vector3_random_gaussian()</title>
<indexterm><primary>vector3_random_gaussian</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_random_gaussian</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_random_gaussian (double avg, double stdev)</computeroutput></para><para>

<para>Generates a random vector within a random gaussian-distributed length. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average of gaussian distribution. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation of gaussian distribution. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>A random vector is generated, normalized and multiplied with
a random value derived from a gaussian distribution.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 502 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a944ac1e3e0632768167b64e3d70933c0"/>    <section>
    <title>vector3_random_unit_sphere()</title>
<indexterm><primary>vector3_random_unit_sphere</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_random_unit_sphere</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_random_unit_sphere ( )</computeroutput></para><para>

<para>Generates a random vector on the unit sphere. </para>
</para>

<para><formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>A random vector is generated with a uniform distribution on the unit sphere.
</computeroutput></literallayout> Reference: Press W.H. et al (1992) Numerical Recipes in C. </para>
</formalpara>
</para>
<para>
Definition at line 419 of file random_numbers.cpp.</para>
    </section><anchor xml:id="_random__numbers_8h_1a6cb6986b2b1763e3e8139621744e635b"/>    <section>
    <title>vector3_xy_random_gaussian()</title>
<indexterm><primary>vector3_xy_random_gaussian</primary><secondary>random_numbers.h</secondary></indexterm>
<indexterm><primary>random_numbers.h</primary><secondary>vector3_xy_random_gaussian</secondary></indexterm>
<para><computeroutput><link linkend="_class_vector3">Vector3</link>&lt;double&gt; vector3_xy_random_gaussian (double avg, double stdev)</computeroutput></para><para>

<para>Generates a random vector within a random gaussian-distributed length in the xy plane. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>avg</entry>
                                <entry>
<para>average of gaussian distribution. </para>
</entry>
                            </row>
                            <row>
                                <entry>stdev</entry>
                                <entry>
<para>standard deviation of gaussian distribution. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_vector3">Vector3&lt;double&gt;</link> vector. <literallayout><computeroutput>A random vector is generated, the z-component set to zero, normalized 
and multiplied with a random value derived from a gaussian distribution.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 522 of file random_numbers.cpp.</para>
</section>
</section>
</section>
