<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * 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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="eval3dp">
    <refnamediv>
        <refname>eval3dp</refname>
        <refpurpose>compute facets of a 3D parametric surface</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>[Xf,Yf,Zf]=eval3dp(fun,p1,p2)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>Xf,Yf,Zf</term>
                <listitem>
                    <para>
                        matrices of size (4,n-1*m-1). <literal>Xf(:,i)</literal> ,<literal>Yf(:,i)</literal> and <literal>Zf(:,i)</literal>  are respectively the x-axis, y-axis and z-axis coordinates of the 4 points of  the ith four sided facet.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>fun</term>
                <listitem>
                    <para>a Scilab function.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>p1</term>
                <listitem>
                    <para>
                        a vector of size <literal>n</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>p2</term>
                <listitem>
                    <para>
                        a vector of size <literal>m</literal>.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>eval3dp</literal> computes a four sided facets representation of a 3D parametric surface
            defined by the function <literal>fun</literal>. <literal>fun(p1,p2)</literal> computes the
            x-axis ,y-axis and z-axis coordinates of the corresponding points on the
            surface, as [x(i),y(i),z(i)]=fun(p1(i),p2(i)). This is used for efficiency.
        </para>
    </refsection>

    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
p1=linspace(0,2*%pi,10);
p2=linspace(0,2*%pi,10);
deff("[x,y,z]=scp(p1,p2)",["x=p1.*sin(p1).*cos(p2)";..
                           "y=p1.*cos(p1).*cos(p2)";..
                           "z=p1.*sin(p2)"])
[Xf,Yf,Zf]=eval3dp(scp,p1,p2);
plot3d(Xf,Yf,Zf)
 ]]></programlisting>
        <scilab:image>p1=linspace(0,2*%pi,10);
            p2=linspace(0,2*%pi,10);
            deff("[x,y,z]=scp(p1,p2)",["x=p1.*sin(p1).*cos(p2)";..
            "y=p1.*cos(p1).*cos(p2)";..
            "z=p1.*sin(p2)"])
            [Xf,Yf,Zf]=eval3dp(scp,p1,p2);
            plot3d(Xf,Yf,Zf)
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="genfac3d">genfac3d</link>
            </member>
            <member>
                <link linkend="plot3d">plot3d</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
