Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > 8c84ab5fe0ecd5f81b4e4e07120af05b > files > 946

povray-3.6.1-8mdv2010.1.i586.rpm


<!--  This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004  -->
<html> 
<head>
  
<!--  NOTE: In order to users to help find information about POV-Ray using  -->
 
<!--  web search engines, we ask you to *not* let them index documentation  -->
 
<!--  mirrors because effectively, when searching, users will get hundreds  -->
 
<!--  of results containing the same information! For this reason, the two  -->
 
<!--  meta tags below disable archiving and indexing of this page by all  -->
 
<!--  search engines that support these meta tags.  -->
 
 <meta content="noarchive" name="robots">
   
 <meta content="noindex" name="robots">
   
 <meta content="no-cache" http-equiv="Pragma">
   
 <meta content="0" http-equiv="expires">
   
<title>3.7.11 rand.inc</title>
 <link href="povray35.css" rel="stylesheet" type="text/css"> 
</head>
 <body> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_141.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_141.html">3.7.10 metals.inc, golds.inc</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>3.7.11 
   rand.inc</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_143.html">3.7.12 shapes.inc, shapes_old.inc, shapes2.inc, 
   shapesq.inc</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_143.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 
<h3><a name="s03_07_11">3.7.11 </a>rand.inc</h3>

<p>
  A collection of macros for generating random numbers, as well as 4 predefined random number streams: <code>RdmA, 
 RdmB, RdmC,</code> and <code>RdmD</code>. There are macros for creating random numbers in a flat distribution (all 
 numbers equally likely) in various ranges, and a variety of other distributions. 
</p>

<h4><a name="s03_07_11_01">3.7.11.1 </a>Flat Distributions</h4>
<a name="s03_07_11_01_i1"><a name="SRand"></a>
<p>
  <code>SRand(Stream)</code>. &quot;Signed rand()&quot;, returns random numbers in the range [-1, 1]. <br>Parameters: 
</p>

<ul>
 
 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i2"><a name="RRand"></a>
<p>
  <code>RRand(Min, Max, Stream)</code>. Returns random numbers in the range [Min, Max].<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Min</code> = The lower end of the output range. 
 </li>

 <li>
   <code>Max</code> = The upper end of the output range. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i3"><a name="VRand"></a>
<p>
  <code>VRand(Stream)</code>. Returns random vectors in a box from &lt; 0, 0, 0&gt; to &lt; 1, 1, 1&gt;<br> 
 Parameters: 
</p>

<ul>
 
 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i4"><a name="VRand_In_Box"></a>
<p>
  <code>VRand_In_Box(PtA, PtB, Stream)</code>. Like VRand(), this macro returns a random vector in a box, but this 
 version lets you specify the two corners of the box.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>PtA</code> = Lower-left-bottom corner of box. 
 </li>

 <li>
   <code>PtB</code> = Upper-right-top corner of box. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i5"><a name="VRand_In_Sphere"></a>
<p>
  <code>VRand_In_Sphere(Stream)</code>. Returns a random vector in a unit-radius sphere located at the origin.<br> 
 Parameters: 
</p>

<ul>
 
 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i6"><a name="VRand_On_Sphere"></a>
<p>
  <code>VRand_On_Sphere(Stream)</code>. Returns a random vector on the surface of a unit-radius sphere located at the 
 origin.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_01_i7"><a name="VRand_In_Obj"></a>
<p>
  <code>VRand_In_Obj(Object, Stream)</code> This macro takes a solid object and returns a random point that is inside 
 it. It does this by randomly sampling the bounding box of the object, and can be quite slow if the object occupies a 
 small percentage of the volume of its bounding box (because it will take more attempts to find a point inside the 
 object). This macro is best used on finite, solid objects (non-solid objects, such as meshes and bezier patches, do 
 not have a defined &quot;inside&quot;, and will not work).<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Object</code> = The object the macro chooses the points from. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>

<h4><a name="s03_07_11_02">3.7.11.2 </a>Other Distributions</h4>

<h5><a name="s03_07_11_02_01">3.7.11.2.1 </a>Continuous Symmetric Distributions</h5>
<a name="s03_07_11_02_01_i1"><a name="Rand_Cauchy"></a>
<p>
  <code>Rand_Cauchy(Mu, Sigma, Stream)</code>. Cauchy distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean. 
 </li>

 <li>
   <code>Sigma</code> = Standard deviation. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_01_i2"><a name="Rand_Student"></a>
<p>
  <code>Rand_Student(N, Stream)</code>. Student's-t distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>N</code> = degrees of freedom. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_01_i3"><a name="Rand_Normal"></a>
<p>
  <code>Rand_Normal(Mu, Sigma, Stream)</code>. Normal distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean. 
 </li>

 <li>
   <code>Sigma</code> = Standard deviation. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_01_i4"><a name="Rand_Gauss"></a>
<p>
  <code>Rand_Gauss(Mu, Sigma, Stream)</code>. Gaussian distribution. Like Rand_Normal(), but a bit faster.<br> 
 Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean. 
 </li>

 <li>
   <code>Sigma</code> = Standard deviation. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>

<h5><a name="s03_07_11_02_02">3.7.11.2.2 </a>Continuous Skewed Distributions</h5>
<a name="s03_07_11_02_02_i1"><a name="Rand_Spline"></a>
<p>
  <code>Rand_Spline(Spline, Stream)</code>. This macro takes a spline describing the desired distribution. The T 
 value of the spline is the output value, and the .y value its chance of occuring.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Spline</code> = A spline determining the distribution. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i2"><a name="Rand_Gamma"></a>
<p>
  <code>Rand_Gamma(Alpha, Beta, Stream)</code>. Gamma distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Alpha</code> = Shape parameter &gt; 0. 
 </li>

 <li>
   <code>Beta</code> = Scale parameter &gt; 0. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i3"><a name="Rand_Beta"></a>
<p>
  <code>Rand_Beta(Alpha, Beta, Stream)</code>. Beta variate.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Alpha</code> = Shape Gamma1. 
 </li>

 <li>
   <code>Beta</code> = Scale Gamma2. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i4"><a name="Rand_Chi_Square"></a>
<p>
  <code>Rand_Chi_Square(N, Stream)</code>. Chi Square random variate.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>N</code> = Degrees of freedom (integer). 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i5"><a name="Rand_F_Dist"></a>
<p>
  <code>Rand_F_Dist(N, M, Stream)</code>. F-distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>N, M</code> = Degrees of freedom. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i6"><a name="Rand_Tri"></a>
<p>
  <code>Rand_Tri(Min, Max, Mode, Stream)</code>. Triangular distribution <br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Min, Max, Mode</code>: Min &lt; Mode &lt; Max. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i7"><a name="Rand_Erlang"></a>
<p>
  <code>Rand_Erlang(Mu, K, Stream)</code>. Erlang variate.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean &gt;= 0. 
 </li>

 <li>
   <code>K</code> = Number of exponential samples. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i8"><a name="Rand_Exp"></a>
<p>
  <code>Rand_Exp(Lambda, Stream)</code>. Exponential distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Lambda</code> = rate = 1/mean. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i9"><a name="Rand_Lognormal"></a>
<p>
  <code>Rand_Lognormal(Mu, Sigma, Stream)</code>. Lognormal distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean. 
 </li>

 <li>
   <code>Sigma</code> = Standard deviation. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i10"><a name="Rand_Pareto"></a>
<p>
  <code>Rand_Pareto(Alpha, Stream)</code>. Pareto distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Alpha</code> = ? 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_02_i11"><a name="Rand_Weibull"></a>
<p>
  <code>Rand_Weibull(Alpha, Beta, Stream)</code>. Weibull distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Alpha</code> = ? 
 </li>

 <li>
   <code>Beta</code> = ? 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>

<h5><a name="s03_07_11_02_03">3.7.11.2.3 </a>Discrete Distributions </h5>
<a name="s03_07_11_02_03_i1"><a name="Rand_Bernoulli"></a>
<p>
  <code>Rand_Bernoulli(P, Stream)</code> and <code>Prob(P, Stream)</code>. Bernoulli distribution. Output is true 
 with probability equal to the value of P and false with a probability of 1 - P.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>P</code> = probability range (0-1). 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_03_i2"><a name="Rand_Binomial"></a>
<p>
  <code>Rand_Binomial(N, P, Stream)</code>. Binomial distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>N</code> = Number of trials. 
 </li>

 <li>
   <code>P</code> = Probability (0-1) 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_03_i3"><a name="Rand_Geo"></a>
<p>
  <code>Rand_Geo(P, Stream)</code>. Geometric distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>P</code> = Probability (0-1). 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
<a name="s03_07_11_02_03_i4"><a name="Rand_Poisson"></a>
<p>
  <code>Rand_Poisson(Mu, Stream)</code>. Poisson distribution.<br> Parameters: 
</p>

<ul>
 
 <li>
   <code>Mu</code> = Mean. 
 </li>

 <li>
   <code>Stream</code> = Random number stream. 
 </li>

</ul>
 <br> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_141.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_141.html">3.7.10 metals.inc, golds.inc</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong>3.7.11 rand.inc</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_143.html">3.7.12 shapes.inc, shapes_old.inc, shapes2.inc, 
   shapesq.inc</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_143.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 </body> </html>