3
3
* Add some comments about XML file
5
5
<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" version="5.0-subset Scilab" xml:lang="en_US" xml:id="comet3d">
7
<refname>comet3d</refname>
8
<refpurpose>3D comet animated plot. </refpurpose>
11
<title>Calling Sequence</title>
12
<synopsis>comet3d(z)</synopsis>
13
<synopsis>comet3d(x,y,z)</synopsis>
14
<synopsis>comet3d(x,y,fun)</synopsis>
15
<synopsis>comet3d(x,y,z,p)</synopsis>
16
<synopsis>comet3d(x,y,fun,p)</synopsis>
17
<synopsis>comet3d(...,"colors",c)</synopsis>
20
<title>Parameters</title>
26
a real vector or matrix. If omitted, it is assumed to be the vector
27
<literal>1:nz</literal> where <literal>nz</literal> is the
28
number of curve points given by the <literal>z</literal>
37
a real vector or matrix. If omitted, it is assumed to be the vector
38
<literal>1:nz</literal> where <literal>nz</literal> is the
39
number of curve points given by the <literal>z</literal>
48
a real vector of length <literal>nz</literal> or a matrix with <literal>nz</literal> rows.
56
a real scalar in the interval<literal>[0 1[</literal>. Default value is 0.1.
64
a scilab function with calling sequence <literal>z=fun(x,y)</literal>.
72
a vector of <literal>ny</literal> color index.
79
<title>Description</title>
81
If <literal>(x,y,z)</literal> are three vectors with the same number of elements, this function draws a 3D comet
82
animated plot. The plot is made of three parts:
86
mark that shows the current <literal>(x(i),y(i),z(i))</literal> position.
92
<term>abody</term> that shows the trailing curve that
94
<literal>(x(i-k:i),y(i-k:i),z(i-k:i))</literal>) part of the curve.
101
that shows the <literal>(x(1:i-k),y(1:i-k),z(1:i-k))</literal> part of the curve.
108
if <literal>z</literal> is a matrix and
109
<literal>(x,y)</literal> are vectors then animated curves
110
are drawn for each triple <literal>(x,y,z(:,l))</literal>.
111
in this case <literal>nz</literal> is the number of rows of
112
<literal>z</literal>.
115
if <literal>x,y,z</literal> are matrices with the same dimensions then animated curves
116
are drawn for each triple <literal>(x(:,l),y(:,l),z(:,l))</literal>.
120
<literal>comet3d(x,y,fun,...)</literal> computes the
121
<literal>z</literal> vector as
122
<literal>z(i)=fun(x(i),y(i))</literal>
125
<literal>comet3d(...,p)</literal> can be used to set the
126
relative length of the body. <literal>k</literal> is defined
127
as <literal>k = round(p*nz)</literal>.
133
<title>Examples</title>
134
<programlisting role="example"><![CDATA[
7
<refname>comet3d</refname>
8
<refpurpose>3D comet animated plot. </refpurpose>
11
<title>Calling Sequence</title>
12
<synopsis>comet3d(z)</synopsis>
13
<synopsis>comet3d(x,y,z)</synopsis>
14
<synopsis>comet3d(x,y,fun)</synopsis>
15
<synopsis>comet3d(x,y,z,p)</synopsis>
16
<synopsis>comet3d(x,y,fun,p)</synopsis>
17
<synopsis>comet3d(...,"colors",c)</synopsis>
20
<title>Parameters</title>
26
a real vector or matrix. If omitted, it is assumed to be the vector
27
<literal>1:nz</literal> where <literal>nz</literal> is the
28
number of curve points given by the <literal>z</literal>
37
a real vector or matrix. If omitted, it is assumed to be the vector
38
<literal>1:nz</literal> where <literal>nz</literal> is the
39
number of curve points given by the <literal>z</literal>
48
a real vector of length <literal>nz</literal> or a matrix with <literal>nz</literal> rows.
56
a real scalar in the interval<literal>[0 1[</literal>. Default value is 0.1.
64
a scilab function with calling sequence <literal>z=fun(x,y)</literal>.
72
a vector of <literal>ny</literal> color index.
79
<title>Description</title>
81
If <literal>(x,y,z)</literal> are three vectors with the same number of elements, this function draws a 3D comet
82
animated plot. The plot is made of three parts:
86
mark that shows the current <literal>(x(i),y(i),z(i))</literal> position.
92
<term>abody</term> that shows the trailing curve that
94
<literal>(x(i-k:i),y(i-k:i),z(i-k:i))</literal>) part of the curve.
101
that shows the <literal>(x(1:i-k),y(1:i-k),z(1:i-k))</literal> part of the curve.
108
if <literal>z</literal> is a matrix and
109
<literal>(x,y)</literal> are vectors then animated curves
110
are drawn for each triple <literal>(x,y,z(:,l))</literal>.
111
in this case <literal>nz</literal> is the number of rows of
112
<literal>z</literal>.
115
if <literal>x,y,z</literal> are matrices with the same dimensions then animated curves
116
are drawn for each triple <literal>(x(:,l),y(:,l),z(:,l))</literal>.
120
<literal>comet3d(x,y,fun,...)</literal> computes the
121
<literal>z</literal> vector as
122
<literal>z(i)=fun(x(i),y(i))</literal>
125
<literal>comet3d(...,p)</literal> can be used to set the
126
relative length of the body. <literal>k</literal> is defined
127
as <literal>k = round(p*nz)</literal>.
133
<title>Examples</title>
134
<programlisting role="example"><![CDATA[
135
135
t = linspace(-%pi,%pi,500);
136
136
clf();comet3d(sin(5*t),sin(t),t^2)
137
137
]]></programlisting>
138
<programlisting role="example"><![CDATA[
138
<programlisting role="example"><![CDATA[
139
139
t = linspace(-%pi,%pi,500)';
140
140
clf();comet3d(sin(5*t),sin(t),[t^2,ones(t)])
141
141
]]></programlisting>
142
<programlisting role="example"><![CDATA[
142
<programlisting role="example"><![CDATA[
143
143
t = linspace(-%pi,%pi,500)';
144
144
function z=traj(x,y),z=1.5*sin(x^2)*cos(y),endfunction
145
145
clf();comet3d(cos(t),sin(t),traj)
146
146
]]></programlisting>
149
<title>See Also</title>
150
<simplelist type="inline">
152
<link linkend="comet">comet</link>
157
<title>History</title>
160
<revnumber>5.3.2</revnumber>
161
<revremark>Function comet3d introduced.</revremark>
149
<title>See Also</title>
150
<simplelist type="inline">
152
<link linkend="comet">comet</link>
157
<title>History</title>
160
<revnumber>5.3.2</revnumber>
161
<revremark>Function comet3d introduced.</revremark>