More samples in the graphic help pages Note that they are automatically generated...
[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-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" version="5.0-subset Scilab" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="xarrows">
14   <info>
15     <pubdate>$LastChangedDate$</pubdate>
16   </info>
17   <refnamediv>
18     <refname>xarrows</refname>
19     <refpurpose> draw a set of arrows</refpurpose>
20   </refnamediv>
21   <refsynopsisdiv>
22     <title>Calling Sequence</title>
23     <synopsis>xarrows(nx,ny,[arsize,style])</synopsis>
24   </refsynopsisdiv>
25   <refsection>
26     <title>Arguments</title>
27     <variablelist>
28       <varlistentry>
29         <term>nx,ny</term>
30         <listitem>
31           <para>real vectors or matrices of same size.</para>
32         </listitem>
33       </varlistentry>
34       <varlistentry>
35         <term>arsize</term>
36         <listitem>
37           <para>real scalar, size of the arrow head. The default value can be obtained  by setting arsize to -1.</para>
38         </listitem>
39       </varlistentry>
40       <varlistentry>
41         <term>style</term>
42         <listitem>
43           <para>
44             matrix or scalar. If <literal>style</literal> is a positive scalar  it gives the color to use for all arrows. If it is a negative scalar  then the current color is used. If it is a vector <literal>style(i)</literal> gives the color to use for arrow <literal>i</literal>.
45           </para>
46         </listitem>
47       </varlistentry>
48     </variablelist>
49   </refsection>
50   <refsection>
51     <title>Description</title>
52     <para>
53       <literal>xarrows</literal> draws a set of arrows given by <literal>nx</literal> and <literal>ny</literal>.
54       If <literal>nx</literal> and <literal>ny</literal> are vectors,
55       the ith arrow is defined by
56       <literal>(nx(i),ny(i))--&gt;(nx(i+1),ny(i+1))</literal>.
57       If <literal>nx</literal> and <literal>ny</literal> are matrices:
58     </para>
59     <programlisting role="no-scilab-exec"><![CDATA[ 
60 nx=[xi_1 x1_2 ...; xf_1 xf_2 ...]
61 ny=[yi_1 y1_2 ...; yf_1 yf_2 ...]
62  ]]></programlisting>
63     <para>
64       the <literal>k</literal> th arrow is defined by <literal>(xi_k,yi_k)--&gt;(xf_k,yf_k)</literal>.
65     </para>
66     <para>
67       <literal>xarrows</literal> uses the current graphics scale 
68       which can be set by calling a high level drawing function such as <literal>plot2d</literal>.
69     </para>
70   </refsection>
71   
72   <refsection>
73     <title>Sample</title>
74     <scilab:image>
75       x=2*%pi*(0:9)/8;
76       x1=[sin(x); 9*sin(x)];
77       y1=[cos(x); 9*cos(x)];
78       plot2d([-10,10], [-10,10], [-1,-1], "022")
79       xset("clipgrf")
80       xarrows(x1, y1, 1, 1:10)
81       xset("clipoff")
82     </scilab:image>
83   </refsection>
84   
85   <refsection>
86     <title>Examples</title>
87     <programlisting role="example"><![CDATA[ 
88 x=2*%pi*(0:9)/8;
89 x1=[sin(x); 9*sin(x)];
90 y1=[cos(x); 9*cos(x)];
91 plot2d([-10,10], [-10,10], [-1,-1], "022")
92 xset("clipgrf")
93 xarrows(x1, y1, 1, 1:10)
94 xset("clipoff")
95  ]]></programlisting>
96   </refsection>
97 </refentry>