comet3

Animates a 3-D curve with a moving head and a trailing tail.

Category: Graphics > 2-D and 3-D Plots

Syntax

comet3(z)

Animates z against its index.

comet3(x, y, z)

Animates the path (x, y, z).

comet3(x, y, z, p)

Sets the tail length as a fraction p of the path.

Description

comet3 is the three-dimensional counterpart of comet. It traces the path in 3-D axes, which is useful for trajectories such as a helix or an attractor.

Input arguments

x, y, z
Vectors of the same length with the path coordinates.
p
Tail length as a fraction of the number of points.

Example

A helix

t = linspace(0, 8*pi, 300);
comet3(cos(t), sin(t), t)

In the app, the figure is drawn below the code.

See also

comet plot3 animatedline drawnow