3D comet animated plot
comet3d(z) comet3d(x, y, z) comet3d(x, y, z, Lf) comet3d(x, y, fun) comet3d(x, y, fun, Lf) comet3d(...,"colors", c)
1:np
,
np
being the number of points of the trajectory.
As a matrix, each column defines the x coordinates of the trace of an
individual comet.
1:np
) or matrix.
As a matrix, each column defines the y coordinates of the trace of an
individual comet.
np
, or a matrix with
np
rows. As a matrix, each column defines the z
coordinates of the trace of an individual comet.
nc=size(z,"c")
is the number of comets simultaneously drawn.
[0,1[
. Default value is 0.1:
It defines the Leading fraction of the comet's trace.
The k=Lf*np
most recent points are plotted in thicker line.
z=fun(x,y)
.
nc
colors of the nc
comets traces.
They may be specified as a vector of nc
color indices or
color names or "#RRGGBB" hexadecimal
color codes. Or by a matrix (ncx3) of [r,g,b]
vectors of
Red-Green-Blue intensities in the [0,1] interval.
If (x,y,z)
are three vectors with the same number of elements, this
function draws a 3D comet animated plot. The plot is made of three parts:
a head | mark that shows the current (x(i),y(i),z(i)) position. |
a body | consisting in the k=round(Lf*np) most recent points
of the trajectory, displayed as a thicker part of the trace. |
a tail | that shows the [x(1:i-k), y(1:i-k), z(1:i-k)] part of the curve. |
if z
is a matrix and x
and y
are vectors, then animated curves are drawn for each triple
(x, y, z(:,j))
.
if x,y,z
are matrices with the same dimensions then animated curves
are drawn for each triple (x(:,j), y(:,j), z(:,j))
.
comet3d(x, y, fun,...)
computes the z
vector as
z(i)=fun(x(i),y(i))
.
comet3d(..,"colors",c)
can be used to set the colors of each
trajectory.
Version | Description |
5.3.2 | Function comet3d() introduced. |
6.1.0 | Colors can now be specified also by their name, or by their "#RRGGBB" hexadecimal code, or by their [r g b] Red-Green-Blue intensities. |