56f68f37a17cfbfe6a3e200aa0d24cee43e8d237
[scilab.git] / scilab / modules / special_functions / help / en_US / gamma.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="gamma" xml:lang="en">
17     <refnamediv>
18         <refname>gamma</refname>
19         <refpurpose>The gamma function.</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>y = gamma(x)</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>x</term>
30                 <listitem>
31                     <para>
32                        scalar, vector, matrix, or hypermatrix of real numbers.
33                     </para>
34                     <note>
35                       <literal>gamma</literal> can be overloaded for complex numbers or
36                       of lists, tlists or mlists.
37                     </note>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>y</term>
42                 <listitem>
43                     <para>real vector or matrix with same size than x.</para>
44                 </listitem>
45             </varlistentry>
46         </variablelist>
47     </refsection>
48     <refsection>
49         <title>Description</title>
50         <para>
51             <literal>gamma(x)</literal> evaluates the gamma function at all the
52             elements of <literal>x</literal>. The gamma function is defined by
53             :
54         </para>
55         <informalequation>
56             <mediaobject>
57                 <imageobject>
58                     <imagedata align="center" fileref="../mml/gamma_equation1.mml"/>
59                 </imageobject>
60             </mediaobject>
61         </informalequation>
62         <para>and generalizes the factorial function for real numbers
63             (<literal>gamma(u+1) = u*gamma(u)</literal>).
64         </para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69 // simple examples
70 gamma(0.5)
71 gamma(6)-prod(1:5)
72  ]]></programlisting>
73         <programlisting role="example"><![CDATA[
74 // the graph of the Gamma function on [a,b]
75 a = -3; b = 5;
76 x = linspace(a,b,40000);
77 y = gamma(x);
78 clf()
79 plot2d(x, y, style=0, axesflag=5, rect=[a, -10, b, 10])
80 xtitle("The gamma function on ["+string(a)+","+string(b)+"]")
81 show_window() ]]></programlisting>
82         <scilab:image>
83             a = -3; b = 5;
84             x = linspace(a,b,40000)';
85             y = gamma(x);
86             plot2d(x, y, style=0, axesflag=5, rect=[a, -10, b, 10])
87             xtitle("The gamma function on ["+string(a)+","+string(b)+"]")
88         </scilab:image>
89     </refsection>
90     <refsection role="see also">
91         <title>See also</title>
92         <simplelist type="inline">
93             <member>
94                 <link linkend="gammaln">gammaln</link>
95             </member>
96             <member>
97                 <link linkend="dlgamma">dlgamma</link>
98             </member>
99             <member>
100                 <link linkend="factorial">factorial</link>
101             </member>
102         </simplelist>
103     </refsection>
104     <refsection>
105         <title>History</title>
106         <revhistory>
107             <revision>
108                 <revnumber>5.4.0</revnumber>
109                 <revremark>Overloading allowed for list, mlist, tlist and hypermatrix types.</revremark>
110             </revision>
111             <revision>
112               <revnumber>6.0.2</revnumber>
113               <revremark>
114                 <itemizedlist>
115                   <listitem>
116                     The input can now be an hypermatrix.
117                   </listitem>
118                   <listitem>
119                     <literal>gamma</literal> can now be overloaded for complex numbers.
120                   </listitem>
121                 </itemizedlist>
122               </revremark>
123             </revision>
124         </revhistory>
125     </refsection>
126 </refentry>