9080712330d2e6e0aa0d13970e395e5f1dedce63
[scilab.git] / scilab / modules / graphics / help / en_US / geometric_shapes / xarrows.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ENPC - Jean-Philippe Chancelier
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <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="xarrows">
14     <refnamediv>
15         <refname>xarrows</refname>
16         <refpurpose>draw a set of arrows</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>xarrows(nx, ny, [arsize, color])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>nx, ny</term>
27                 <listitem>
28                     <para>real vectors or matrices of same size.</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>arsize</term>
33                 <listitem>
34                     <para>
35                         a real scalar, size of the arrow head.
36                         The default value can be obtained  by
37                         setting <varname>arsize</varname> to
38                         <literal>-1</literal>.
39                     </para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>color</term>
44                 <listitem>
45                     <para>
46                         a matrix or scalar. If <varname>color</varname>
47                         is a positive scalar it gives the color
48                         to use for all arrows. If it is a
49                         negative scalar then the current color is
50                         used. If it is a vector <literal>color(i)</literal>
51                         gives the color to use for arrow <literal>i</literal>.
52                     </para>
53                 </listitem>
54             </varlistentry>
55         </variablelist>
56     </refsection>
57     <refsection>
58         <title>Description</title>
59         <para>
60             <function>xarrows</function> draws a set of arrows
61             given by <varname>nx</varname> and <varname>ny</varname>.
62             If <varname>nx</varname> and <varname>ny</varname> are vectors,
63             the <literal>i</literal>-th arrow is defined by
64             <literal>(nx(i),ny(i))--&gt;(nx(i+1),ny(i+1))</literal>.
65             If <varname>nx</varname> and <varname>ny</varname> are matrices:
66         </para>
67         <programlisting role="no-scilab-exec"><![CDATA[
68 nx=[xi_1 x1_2 ...; xf_1 xf_2 ...]
69 ny=[yi_1 y1_2 ...; yf_1 yf_2 ...]
70  ]]></programlisting>
71         <para>
72             the <literal>k</literal>-th arrow is defined by <literal>(xi_k,yi_k)--&gt;(xf_k,yf_k)</literal>.
73         </para>
74         <para>
75             <function>xarrows</function> uses the current graphics
76             scale which can be set by calling a high level
77             drawing function such as <function>plot2d</function>.
78         </para>
79     </refsection>
80     <refsection>
81         <title>Examples</title>
82         <programlisting role="example"><![CDATA[
83 x = 2*%pi*(0:7)/8
84 x1 = [sin(x); 9*sin(x)];
85 y1 = [cos(x); 9*cos(x)];
86 plot2d([-10,10], [-10,10], [-1,-1], "022")
87 xset("clipgrf")
88 xarrows(x1, y1, -1, [1:7,9]) //8-th color is white
89 xset("clipoff")
90  ]]></programlisting>
91         <scilab:image>
92             x = 2*%pi*(0:7)/8
93             x1 = [sin(x); 9*sin(x)];
94             y1 = [cos(x); 9*cos(x)];
95             plot2d([-10,10], [-10,10], [-1,-1], "022")
96             xset("clipgrf")
97             xarrows(x1, y1, -1, [1:7,9])
98             xset("clipoff")
99         </scilab:image>
100     </refsection>
101 </refentry>