[doc] champ() page fixed + improved after f94449
[scilab.git] / scilab / modules / graphics / help / pt_BR / 2d_plot / champ.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2020 - Samuel GOUGEON
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org" xml:id="champ" xml:lang="pt">
20     <refnamediv>
21         <refname>champ</refname>
22         <refpurpose>esboço de campo vetorial 2d</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Seqüência de Chamamento</title>
26         <synopsis>
27             champ()  // example
28             champ(x, y, fx, fy)
29             champ(x, y, fx, fy, arfact)
30             champ(x, y, fx, fy, arfact, rect)
31             champ(x, y, fx, fy, arfact, rect, strf)
32             champ(x, y, fx, fy, &lt;opt_args&gt;)
33         </synopsis>
34     </refsynopsisdiv>
35     <refsection>
36         <title>Parâmetros</title>
37         <variablelist>
38             <varlistentry>
39                 <term>x,y</term>
40                 <listitem>
41                     <para>
42                         vectors of decimal numbers, which define the grid of nodes
43                         = coordinates of arrows starting points.
44                     </para>
45                 </listitem>
46             </varlistentry>
47             <varlistentry>
48                 <term>fx</term>
49                 <listitem>
50                     <para>uma matriz que descreve o componente x do campo vetorial.
51                         <literal>fx(i,j)</literal> é o componente x do campo vetorial no
52                         ponto <literal>(x(i),y(j))</literal>.
53                     </para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>fy</term>
58                 <listitem>
59                     <para>uma matriz que descreve o componente y do campo vetorial.
60                         <literal>fy(i,j)</literal>é o componente y do campo vetorial no
61                         ponto <literal>(x(i),y(j))</literal>.
62                     </para>
63                 </listitem>
64             </varlistentry>
65             <varlistentry>
66                 <term>&lt;opt_args&gt;</term>
67                 <listitem>
68                     <para>representa a seqüência de declarações
69                         <literal>key1=value1,key2=value2</literal>,... onde
70                         <literal>key1</literal>, <literal>key2,...</literal> podem ser um
71                         dos seguintes: arfact, rect, strf (ver abaixo).
72                     </para>
73                 </listitem>
74             </varlistentry>
75             <varlistentry>
76                 <term>arfact</term>
77                 <listitem>
78                     <para>um argumento opcional do tipo real que fornece um fator de
79                         escala para a exibição das cabeças das setas no esboço (o valor
80                         padrão é 1.0).
81                     </para>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>rect</term>
86                 <listitem>
87                     <para>
88                         um vetor <literal>rect=[xmin,ymin,xmax,ymax]</literal> que
89                         fornece as fronteiras da moldura gráfica à ser utilizada.
90                     </para>
91                 </listitem>
92             </varlistentry>
93             <varlistentry>
94                 <term>strf</term>
95                 <listitem>
96                     <para>um string de comprimento 3 "xyz" que possui o mesmo
97                         significado do parâmetro <literal>strf</literal> de
98                         <literal>plot2d</literal>. O primeiro caractere não tem efeito com
99                         <literal>champ</literal>.
100                     </para>
101                 </listitem>
102             </varlistentry>
103         </variablelist>
104     </refsection>
105     <refsection>
106         <title>Descrição</title>
107         <para>
108             <literal>champ(…)</literal> plota um campo de vetores 2D com setas.
109         </para>
110         <para>
111             By default, all arrows have the same color, and their length is
112             proportional to the local intensity of the field (norm of vectors).
113             In addition, all lengths are normalized according to the longest arrow.
114         </para>
115         <para>
116             When setting <literal>gce().colored = "on"</literal>,
117             each arrow becomes as long as possible in its cell, and is colored
118             according to the local intensity of the field.
119         </para>
120         <para>
121             After calling <literal>champ(…)</literal>, <literal>gce()</literal>
122             returns the handle of the field of arrows, of type <literal>Champ</literal>,
123             whose <link linkend="champ_properties">properties</link> can be post-processed.
124         </para>
125         <para>
126             Entre com o comando <literal>champ()</literal> para visualizar um exemplo.
127         </para>
128     </refsection>
129     <refsection>
130         <title>Exemplos</title>
131         <programlisting role="example"><![CDATA[
132 x = -4:6;
133 X = ndgrid(x);
134 [fx, fy] =  (rand(X)-0.5, rand(X)-0.5);
135
136 clf
137 gcf().color_map = jetcolormap(50);
138
139 // Field's intensity = arrows length
140 subplot(2,2,1)
141 champ(x, x, fx, fy)
142
143 // With bigger arrow heads
144 subplot(2,2,2)
145 champ(x, x, fx, fy, arfact=1.7)
146 title("arfact=1.7", "fontsize",3)
147
148 // Field's intensity = arrows color
149 xsetech([0 0.5 0.55 0.5])
150 champ(x, x, fx, fy, arfact=1.7)
151 gce().colored = "on";
152 title("arfact=1.7, .colored=""on""", "fontsize",3)
153 L = sqrt(fx.^2 + fy.^2);
154 colorbar(min(L), max(L));
155
156 // Field's intensity = color, + imposed boundaries
157 subplot(2,2,4)
158 champ(x, x, fx, fy, rect=[-5,-6,9,7],strf="011")
159 gce().colored = "on";
160 title("rect=[-5,-6,9,6], strf=""011"", .colored=""on""", "fontsize",3)
161
162 gcf().axes_size = [740 680];
163     ]]></programlisting>
164         <scilab:image>
165             x = -4:6;
166             X = ndgrid(x);
167             [fx, fy] =  (rand(X)-0.5, rand(X)-0.5);
168
169             clf
170             gcf().color_map = jetcolormap(50);
171
172             // Field's intensity = arrows length
173             subplot(2,2,1)
174             champ(x, x, fx, fy)
175
176             // With bigger arrow heads
177             subplot(2,2,2)
178             champ(x, x, fx, fy, arfact=1.7)
179             title("arfact=1.7", "fontsize",3)
180
181             // Field's intensity = arrows color
182             xsetech([0 0.5 0.55 0.5])
183             champ(x, x, fx, fy, arfact=1.7)
184             gce().colored = "on";
185             title("arfact=1.7, .colored=""on""", "fontsize",3)
186             L = sqrt(fx.^2 + fy.^2);
187             colorbar(min(L), max(L));
188
189             // Field's intensity = color, + imposed boundaries
190             subplot(2,2,4)
191             champ(x, x, fx, fy, rect=[-5,-6,9,7],strf="011")
192             gce().colored = "on";
193             title("rect=[-5,-6,9,6], strf=""011"", .colored=""on""", "fontsize",3)
194
195             gcf().axes_size = [740 680];
196         </scilab:image>
197         <programlisting role="example"><![CDATA[
198 x = -1.2:0.11:0.7;
199 y = -1:0.11:0.5;
200 [X, Y] = ndgrid(x, y);
201 [fx, fy] = (2*X, 2*Y);
202
203 clf
204 xsetech([0 0 0.45 1])
205 champ(x, y, fx, fy)
206 title(".colored = ""off"" (default)", "fontsize",3)
207 xsetech([0.45 0 0.55 1])
208 champ(x, y, fx, fy)
209 title(".colored = ""on""", "fontsize",3)
210 gce().colored = "on";
211
212 gcf().color_map = jetcolormap(100);
213 L = sqrt(fx.^2 + fy.^2);
214 colorbar(min(L), max(L));
215 ]]></programlisting>
216         <scilab:image>
217             x = -1.2:0.11:0.7;
218             y = -1:0.11:0.5;
219             [X, Y] = ndgrid(x, y);
220             [fx, fy] = (2*X, 2*Y);
221
222             clf
223             xsetech([0 0 0.45 1])
224             champ(x, y, fx, fy)
225             title(".colored = ""off"" (default)", "fontsize",3)
226             xsetech([0.45 0 0.55 1])
227             champ(x, y, fx, fy)
228             title(".colored = ""on""", "fontsize",3)
229             gce().colored = "on";
230
231             gcf().color_map = jetcolormap(100);
232             L = sqrt(fx.^2 + fy.^2);
233             colorbar(min(L), max(L));
234
235             gcf().axes_size = [720 340];
236         </scilab:image>
237     </refsection>
238     <refsection role="see also">
239         <title>Ver Também</title>
240         <simplelist type="inline">
241             <member>
242                 <link linkend="champ_properties">champ_properties</link>
243             </member>
244             <member>
245                 <link linkend="fchamp">fchamp</link>
246             </member>
247             <member>
248                 <link linkend="xarrows">xarrows</link>
249             </member>
250             <member>
251                 <link linkend="polyline_properties">Arrowed polyline</link>
252             </member>
253         </simplelist>
254     </refsection>
255 </refentry>