<?xml version="1.0" encoding="UTF-8"?>
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="bsplin3val" xml:lang="pt">
    <refnamediv>
        <refname>bsplin3val</refname>
        <refpurpose>função de avaliação de derivada arbitrária de spline
            3d
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Seqüência de Chamamento</title>
        <synopsis>[dfp]=bsplin3val(xp,yp,zp,tl,der)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Parâmetros</title>
        <variablelist>
            <varlistentry>
                <term>xp, yp, zp</term>
                <listitem>
                    <para>vetores ou matrizes de reais de tamanhos iguais </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>tl</term>
                <listitem>
                    <para>tlist de tipo "splin3d", definindo um tensor spline 3d
                        (chamado de <literal>s</literal> a seguir)
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>der</term>
                <listitem>
                    <para>
                        vetor com três componentes <literal>[ox,oy,oz]</literal>
                        definindo qual derivada de <literal>s</literal> computar.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>dfp</term>
                <listitem>
                    <para>
                        vetor ou matriz de mesmo formato que <literal>xp</literal>,
                        <literal>yp</literal> e <literal>zp</literal>, avaliação elemento a
                        elemento da derivada especificada de <literal>s</literal> nesses
                        pontos.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Descrição</title>
        <para>
            Enquanto a função <link linkend="interp3d">interp3d</link> pode
            computar apenas o spline <literal>s</literal> e suas primeiras derivadas,
            <literal>bsplin3val</literal> pode computar qualquer derivada de
            <literal>s</literal>. A derivada a ser computada é especificada pelo
            argumento <literal>der=[ox,oy,oz]</literal> :
        </para>
        <programlisting role=""><![CDATA[
            ox   oy   oz
           d    d    d
dfp(i) =  ---  ---  ---   s (xp(i),yp(i),zp(i))
            ox   oy   oz
          dx   dy   dz
 ]]></programlisting>
        <para>
            Então, <literal>der=[0 0 0]</literal> corresponde a
            <emphasis>s</emphasis>, <literal>der=[1 0 0]</literal> to
            <emphasis>ds/dx</emphasis>, <literal>der=[0 1 0]</literal> to
            <emphasis>ds/dy</emphasis>, <literal>der=[1 1 0]</literal> to
            <emphasis>d2s/dxdy</emphasis>, etc...
        </para>
        <para>Para um ponto com coordenadas
            <emphasis>(xp(i),yp(i),zp(i))</emphasis> fora do grid, a função retorna 0.
        </para>
    </refsection>
    <refsection>
        <title>Exemplos</title>
        <programlisting role="example"><![CDATA[
deff("v=f(x,y,z)","v=cos(x).*sin(y).*cos(z)");
deff("v=fx(x,y,z)","v=-sin(x).*sin(y).*cos(z)");
deff("v=fxy(x,y,z)","v=-sin(x).*cos(y).*cos(z)");
deff("v=fxyz(x,y,z)","v=sin(x).*cos(y).*sin(z)");
deff("v=fxxyz(x,y,z)","v=cos(x).*cos(y).*sin(z)");
n = 20;  // n x n x n  pontos de interpolação
x = linspace(0,2*%pi,n); y=x; z=x; // grid de interpolação
[X,Y,Z] = ndgrid(x,y,z); V = f(X,Y,Z);
tl = splin3d(x,y,z,V,[5 5 5]);

// computando f e algumas derivadas em um ponto
// e comparando com o spline interpolante
xp = grand(1,1,"unf",0,2*%pi);
yp = grand(1,1,"unf",0,2*%pi);
zp = grand(1,1,"unf",0,2*%pi);

f_e = f(xp,yp,zp)
f_i = bsplin3val(xp,yp,zp,tl,[0 0 0])

fx_e = fx(xp,yp,zp)
fx_i = bsplin3val(xp,yp,zp,tl,[1 0 0])

fxy_e = fxy(xp,yp,zp)
fxy_i = bsplin3val(xp,yp,zp,tl,[1 1 0])

fxyz_e = fxyz(xp,yp,zp)
fxyz_i = bsplin3val(xp,yp,zp,tl,[1 1 1])

fxxyz_e = fxxyz(xp,yp,zp)
fxxyz_i = bsplin3val(xp,yp,zp,tl,[2 1 1])
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>Ver Também</title>
        <simplelist type="inline">
            <member>
                <link linkend="splin3d">splin3d</link>
            </member>
            <member>
                <link linkend="interp3d">interp3d</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>Autores</title>
        <simplelist type="vert">
            <member>R.F. Boisvert, C. De Boor (código da biblioteca FORTRAN CMLIB)
            </member>
            <member>B. Pincon (interface Scilab)</member>
        </simplelist>
    </refsection>
</refentry>
