Plotting curves in space

This section describes dynagraph's spacecurve() command for plotting curves in space. Dynagraph's concept of a space curve is a one-dimensional ordered sequence of points mapped into the three-dimensional space.

A space curve can be displayed as a continuous curve (in which case its points are connected by straight line segments) or a set of disconnected points in space. Unlike surfaces, space curves are not affected by dynagraph's light settings and appear at a fixed color and intensity.

The spacecurve() command

    spacecurve([f, g, h], t=a..b);

       f, g, h: expressions in t

Numerous optional arguments can modify the default appearance of the curve. These are described in Plotting Options. In particular, the option numpoints=n determines the number of points that will be used to draw the curve.

Multiple curves can be plotted with one spacecurve command by enclosing curve definitions in curly braces {...}.

Examples:

    > spacecurve([cos(t),sin(t),t/4] ,t=0..4*Pi);
    > spacecurve( { [cos(t),sin(t),t/6], [sin(t),cos(t),t/6] },
            t=0..4*Pi, thickness=4);

    # The following from Maple's spacecurve demo:
    > spacecurve({ [sin(t), 0, cos(t)], [cos(t)+1,sin(t),0] },
            t=0..2*Pi, numpoints=11, thickness=5);

Space curves and surface plots can be saved and then displayed together with the display() command:

Examples:

    > p1 := spacecurve([cos(t),sin(t),t/4], t=0..4*Pi, thickness=5);
    > p2 := plot3d(x^2+y^2,x=-1..1,y=-1..1);
    > display([p1,p2]);
Back to table of contents