<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://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="genfac3d">
    <refnamediv>
        <refname>genfac3d</refname>
        <refpurpose>Compute facets of a 3D surface</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>[xx,yy,zz]=genfac3d(x,y,z,[mask])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>xx,yy,zz</term>
                <listitem>
                    <para>
                        matrices of size (4,n-1xm-1). <literal>xx(:,i)</literal> ,<literal>yy(:,i)</literal> and <literal>zz(:,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>x</term>
                <listitem>
                    <para>x-axis coordinates vector of size m.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>y</term>
                <listitem>
                    <para>y-axis coordinates vector of size n.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>z</term>
                <listitem>
                    <para>
                        matrix of size (m,n). <literal>z(i,j)</literal> is the value of the surface at the point (x(i),y(j)).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>mask</term>
                <listitem>
                    <para>
                        boolean optional matrix with same size as <literal>z</literal> used to select  the entries of <literal>z</literal> to be represented by facets.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>genfac3d</literal> computes a four sided facets representation of a 3D surface
            <literal>z=f(x,y)</literal> defined by <literal>x</literal>, <literal>y</literal> and <literal>z</literal>.
        </para>
    </refsection>

    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
t=[0:0.3:2*%pi]';
z=sin(t)*cos(t');
[xx,yy,zz]=genfac3d(t,t,z);
plot3d(xx,yy,zz)
 ]]></programlisting>

        <scilab:image>
            t=[0:0.3:2*%pi]';
            z=sin(t)*cos(t');
            [xx,yy,zz]=genfac3d(t,t,z);
            plot3d(xx,yy,zz)
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="eval3dp">eval3dp</link>
            </member>
            <member>
                <link linkend="plot3d">plot3d</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
