Plot

Loading Ebi…
let ax = ThreeDAxes(x_range=[-3, 3, 1], y_range=[-3, 3, 1], z_range=[-2, 2, 1])
fn trajectory(t: Number): List<Number, 3> {
    return [t, 2 * sin(t), 1.5 * cos(2 * t)]
}
let trace = ax.plot_parametric_curve(trajectory, t_range=[-3, 3])
mut heading = -90deg
mut elevation = 90deg
mut depth = 0
sig camera = Camera3D(azimuth=heading, elevation=elevation)
<Scene3D camera={camera} depth={depth}>
    {ax.frame()}
    {trace}
</Scene3D>
<Animation flow="sequence">
    {wait(400ms)}
    <Animation flow="parallel">
        {animate(elevation, to=28deg, duration=1.8s, ease="smootherstep")}
        {animate(heading, to=-45deg, duration=1.8s, ease="smootherstep")}
        {animate(depth, to=1, duration=1.8s, ease="smootherstep")}
    </Animation>
    {animate(heading, to=180deg, duration=3s, ease="smootherstep")}
    <Animation flow="parallel">
        {animate(elevation, to=90deg, duration=2s, ease="smootherstep")}
        {animate(heading, to=270deg, duration=2s, ease="smootherstep")}
        {animate(depth, to=0, duration=2s, ease="smootherstep")}
    </Animation>
</Animation>

Surfaces and series

UseTo draw
ax.plot_surface(f), ax.plot_parametric_surface(f)A height z = f(x, y) or points [x, y, z] returned by f(u, v).
ax.plot_parametric_curve(f), ax.plot_line_graph(points), ax.scatter(points)A curve or points in three-dimensional data coordinates.
SurfaceGrid, Wireframe, Path3D, Scatter3D, Arrow3DGeometry in world coordinates, such as [20pt, 30pt, 0pt].

Series in one Scene3D share its camera. Animate its camera, depth, or series list from signals. Use SurfaceGrid for a surface with live vertices. Set perspective=true for perspective or animate zoom, roll, and elevation. Use project3d(point, camera, depth=depth) to make an upright label follow a point. See 3D scenes for meshes and solids.

ax.c2p([x, y, z]) converts data coordinates to world lengths. ax.p2c(point) converts back. If you already have a list of sampled data points, ax.plot_line_graph(points) maps them through the axes and connects them in order.

Use Flow fields to sample a vector field or follow its streamlines.