summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics/help/en_US/3d_plot/comet3d.xml
blob: b51de8e95416398b9315054cdcea84cf1c1481ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Add some comments about XML file
-->
<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" xml:lang="en_US" xml:id="comet3d">
  <info>
    <pubdate>$LastChangedDate: 11-03-2011 $</pubdate>
  </info>
  <refnamediv>
    <refname>comet3d</refname>
    <refpurpose>3D comet animated plot. </refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>comet3d(z)</synopsis>
    <synopsis>comet3d(x,y,z)</synopsis>
    <synopsis>comet3d(x,y,fun)</synopsis>
    <synopsis>comet3d(x,y,z,p)</synopsis>
    <synopsis>comet3d(x,y,fun,p)</synopsis>
    <synopsis>comet3d(...,"colors",c)</synopsis>
  </refsynopsisdiv>
  <refsection>
    <title>Parameters</title>
    <variablelist>
      <varlistentry>
        <term>x</term>
        <listitem>
          <para>
            a real vector or matrix. If omitted, it is assumed to be the vector
            <literal>1:nz</literal> where <literal>nz</literal> is the
            number of curve points given by the <literal>z</literal>
            parameter.
          </para>
        </listitem>
      </varlistentry>
     <varlistentry>
        <term>y</term>
        <listitem>
          <para>
            a real vector or matrix. If omitted, it is assumed to be the vector
            <literal>1:nz</literal> where <literal>nz</literal> is the
            number of curve points given by the <literal>z</literal>
            parameter.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>z</term>
        <listitem>
          <para>
            a real vector of length <literal>nz</literal> or a matrix with  <literal>nz</literal> rows.
           </para>
        </listitem>
      </varlistentry>
     <varlistentry>
        <term>p</term>
        <listitem>
          <para>
            a real scalar in the interval<literal>[0 1[</literal>. Default value is 0.1.
           </para>
        </listitem>
      </varlistentry>
     <varlistentry>
        <term>fun</term>
        <listitem>
          <para>
            a scilab function with calling sequence <literal>z=fun(x,y)</literal>.
           </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>c</term>
        <listitem>
          <para>
            a vector of  <literal>ny</literal> color index.
           </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>
  <refsection>
    <title>Description</title>
    <para>
       If <literal>(x,y,z)</literal> are three vectors with the same number of elements, this function draws a 3D comet
      animated plot. The plot is made of three parts:
         <variablelist>
           <varlistentry>
             <term>a head</term> 
             mark that shows the current <literal>(x(i),y(i),z(i))</literal> position.
             <listitem>
               <para>
               </para>
             </listitem>
           </varlistentry>
           <varlistentry>
             <term>a body</term> that shows the trailing curve that
             follows the head: the
             <literal>(x(i-k:i),y(i-k:i),z(i-k:i))</literal>) part of the curve.
             <listitem>
               <para>
               </para>
             </listitem>
           </varlistentry>
          <varlistentry>
             <term>a tail</term> 
             that shows the  <literal>(x(1:i-k),y(1:i-k),z(1:i-k))</literal>  part of the curve.
             <listitem>
               <para>
               </para>
             </listitem>
           </varlistentry>
         </variablelist>
         <para>
           if <literal>z</literal> is a matrix and
           <literal>(x,y)</literal> are vectors then animated curves
           are drawn for each triple <literal>(x,y,z(:,l))</literal>.
           in this case <literal>nz</literal> is the number of rows of
           <literal>z</literal>.
         </para>
         <para>
           if <literal>x,y,z</literal> are matrices with the same dimensions then animated curves
           are drawn for each triple <literal>(x(:,l),y(:,l),z(:,l))</literal>.
         </para>

         <para>

         <literal>comet3d(x,y,fun,...)</literal> computes the
         <literal>z</literal> vector as
         <literal>z(i)=fun(x(i),y(i))</literal>
         </para>
         <para>
         <literal>comet3d(...,p)</literal> can be used to set the
         relative length of the body. <literal>k</literal> is defined
         as <literal>k = round(p*nz)</literal>.
         </para>

    </para>
  </refsection>
  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
t = linspace(-%pi,%pi,500);
clf();comet3d(sin(5*t),sin(t),t^2)
    ]]></programlisting>
    <programlisting role="example"><![CDATA[
t = linspace(-%pi,%pi,500)';
clf();comet3d(sin(5*t),sin(t),[t^2,ones(t)])
    ]]></programlisting>
    <programlisting role="example"><![CDATA[
function z=traj(x,y),z=1.5*sin(x^2)*cos(y),endfunction
clf();comet3d(cos(t),sin(t),traj)
    ]]></programlisting>
  </refsection>
  <refsection>
    <title>See Also</title>
    <simplelist type="inline">
      <member>
        <link linkend="comet" >comet</link>
      </member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Authors</title>
    <simplelist type="vert">
      <member>Serge Steer</member>
    </simplelist>
  </refsection>

 <refsection>
   <title>History</title>
   <simplelist type="vert">
     <member>First version April 2011, for Scilab-5.3.2</member>
   </simplelist>
 </refsection>

</refentry>