<?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="xrpoly">
    <refnamediv>
        <refname>xrpoly</refname>
        <refpurpose>draw a regular polygon</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>xrpoly(orig,n,r,[theta])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>orig</term>
                <listitem>
                    <para>vector of size 2.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>n</term>
                <listitem>
                    <para>integer, number of sides.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>r</term>
                <listitem>
                    <para>real scalar.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>theta</term>
                <listitem>
                    <para>real, angle in radian; 0 is the default value.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>xrpoly</literal> draws a regular polygon with <literal>n</literal> sides contained in the
            circle of diameter
            <literal>r</literal> and with the origin of the circle set at point <literal>orig</literal>.
            <literal>theta</literal>  specifies a rotation angle in radian. This function uses
            the current graphics scales.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
plot2d(0,0,-1,"012"," ",[0,0,10,10])
xrpoly([5,5],5,5)
 ]]></programlisting>
        <scilab:image>
            plot2d(0,0,-1,"012"," ",[0,0,10,10])
            xrpoly([5,5],5,5)
        </scilab:image>

    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="xrect">xrect</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
