<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2024 - 3DS - Adeline CARNIS
 *
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="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="bernstein" xml:lang="en">
    <refnamediv>
        <refname>bernstein</refname>
        <refpurpose>compute the n-order Bernstein matrix
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>b = bernstein(n, t)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>n</term>
                <listitem>
                    <para>a positive integer, the order. 
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>t</term>
                <listitem>
                    <para>a scalar or row vector. </para>
                    <para>
                        If <literal>t</literal> is scalar, <literal>t</literal> contains the number of points of Bezier curves. In this case, 
                        the <literal>bernstein</literal> function create <literal>linspace(0, 1, t)</literal>vector. If <literal>t</literal> 
                        is vector, this values must be in [0; 1]
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>b</term>
                <listitem>
                    <para>a length(t)-by-(n+1) matrix of doubles.</para>
                </listitem>
            </varlistentry>
        
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            This function returns a matrix <literal>b</literal> containing the Bernstein polynomials 
            evaluated at the elements of <literal>t</literal>
        </para>
        <para>
            This function is used to compute the points of Bezier curve. 
            See <link linkend="bezier">bezier</link> help page.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <para><emphasis role="bold">Compute the matrix of third order Bernstein polynomials</emphasis></para>
        <para>
            <programlisting role="example"><![CDATA[
            t = linspace(0, 1, 5);
            b = bernstein(3, t)
            ]]>
        </programlisting>
        </para>
        <para>
            <programlisting role="example"><![CDATA[
            nb = 4;
            b = bernstein(2, nb)
            ]]>
        </programlisting>
        </para>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="bezier">bezier</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>2024.1.0</revnumber>
                <revremark>Introduction in Scilab.</revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
