Draw a 3D trajectory and a gridded surface
Plot an explicit helix and row major saddle grid with labeled axes, reproducible cameras and standalone offline HTML export.
// Requires the matching spatial-plot-enabled native development runtime.
import aner.plot
import aner.math
// A parametric path connects samples in their original order.
let pathX = List()
let pathY = List()
let pathZ = List()
for sample in Range(81) {
let t = Float64(sample) * 0.15707963267948966
pathX.append(math.cos(t))
pathY.append(math.sin(t))
pathZ.append(t / 6.283185307179586)
}
let trajectory = plot.line3d(pathX, pathY, pathZ)
.labels("x (m)", "y (m)", "z (m)").aspect("equal")
.view(-35.0, 25.0).title("A supplied helix connects 81 ordered samples")
.caption("Synthetic parametric path: x=cos(t), y=sin(t), z=t/(2π), 0≤t≤4π. No smoothing, fitted trajectory or physical simulation.")
.theme(plot.theme("light")).size(940, 640)
trajectory.show()
// Surface axes are strictly increasing; z is row-major, one row per y.
let gridX = List()
let gridY = List()
let gridZ = List()
for column in Range(21) { gridX.append(-2.0 + Float64(column) * 0.2) }
for row in Range(17) { gridY.append(-2.0 + Float64(row) * 0.25) }
for row in Range(17) {
let y = -2.0 + Float64(row) * 0.25
for column in Range(21) {
let x = -2.0 + Float64(column) * 0.2
gridZ.append((x * x - y * y) / 4.0)
}
}
let saddle = plot.surface3d(x: gridX, y: gridY, z: gridZ)
.labels("x (m)", "y (m)", "Response (arbitrary units)")
.color_label("Response (arbitrary units)").color_limits(-1.0, 1.0)
.aspect("auto").view(-45.0, 30.0)
.title("An explicitly sampled saddle surface")
.caption("Synthetic z=(x²−y²)/4 on a 17×21 rectangular grid. Flat triangles join supplied neighboring vertices; no fitted surface. Auto aspect normalizes each axis independently.")
.theme(plot.theme("light")).size(1000, 680)
saddle.show()
// Export initial native views, using fresh filenames.
trajectory.save("spatial-trajectory.html")
trajectory.save("spatial-trajectory.svg")
saddle.save("spatial-surface.html")
saddle.save("spatial-surface.svg")
Run step by step in VS Code.
The notebook separates observations and chart construction into cells. It opens with empty outputs and shared variables. Map cells state which optional local packs they need.
- Install a compatible native Aner executable and VS Code extension using the editor guide. Chart construction and interactive geographic navigation require the matching development runtime and editor.
- Download the
.anernbnotebook and open it in your VS Code project. If it appears as JSON, choose Reopen Editor With… → Aner Notebook. - Select the
Aner — notebookkernel and keep Shared variables active. Run code cells from top to bottom, or choose Run All. Later cells reuse observations and chart values from earlier cells. Run cells that need no pack before trying the optional geographic map. - Read the figures below their producing cells. In geographic outputs, drag to pan and use the zoom controls to reveal crowded labels. Static SVG exports retain the initial view. Source observations, units and limitations remain in each caption.
After changing an earlier cell, rerun its dependent cells. Use Aner: Restart Notebook Session, then Run All, for a clean experiment. Saved outputs are historical; reopening the file starts without live variables. The notebook guide explains session state, inspection, and runtime controls.
Run step by step in Jupyter.
Download the .ipynb notebook and open it in a notebook application with the Aner kernel configured. Select Aner and run its cells from top to bottom. The Jupyter guide explains kernel requirements, shared session state and output policies.
The dashboard uses local date and site controls after the producing cell finishes. Notebook trust and script policies determine whether interaction is displayed; the initial SVG and exported HTML provide the documented fallbacks. Optional map pack requirements are stated in the notebook.
Make it your experiment.
With a compatible development runtime installed, save this program as examples/plot_spatial3d.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/plot_spatial3d.aner
aner run examples/plot_spatial3d.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires an updated native Aner development runtime supporting Cartesian 3D plots and the matching VS Code extension for .anernb, or the optional Aner kernel integration for Jupyter .ipynb. Aner Plot awaits a binary release and is not included in the published research preview; development packages are not offered here. The supplied analysis needs no map pack, credentials, server or connection. Native source and both notebook formats share the same analysis. Source export uses fresh HTML and SVG filenames; existing files are never overwritten.
aner check examples/plot_spatial3d.aner
aner run examples/plot_spatial3d.anerObservations are synthetic teaching inputs. Geographic context comes from optional offline boundary packs and does not add street detail or establish observed traffic conditions.
Read the chart and map contracts