Uses the oxframe skill (workflow, full API cheat sheet); install both with npx skills add oxygenframe/oxframe-sdk.
#[oxframe::scene]
async fn derivative(view: View) {
let axes = view.add(Axes::new().x_range(-3.0..3.0).y_range(-1.5..1.5));
let f = axes.plot(|x| x.sin());
f.draw_on().await;
let x = Signal::new(-3.0);
axes.point_on(&f, x.clone());
x.to(3.0, 3.0).await;
f.to_fn(|x| x.cos(), 1.0).await; // morph into the derivative
}
- Functions:
axes.plot(|x| …)follows the ranges (axes.x_range().to(..)zooms) and keeps gaps (tan).point_on,to_fn,axes.place(node, x, y). - Linear algebra:
axes.vector(x, y)(tip is signals),axes.apply_matrix([[a, b], [c, d]], secs)bends the grid and everything on it;Matrix::new([[1, 2], [3, 4]])withrow_frame,column_frame,cell(r, c)to point at entries. - Number lines and bars:
NumberLine::new(0.0..10.0),axes.bars([..]). - 3D surfaces or solids:
Scene3d+View3d(feature3d). - Formulas: there is no LaTeX/Typst yet. Write short expressions with Unicode (
f′(x) = cos x,∑,√, superscripts) inTxt, or as matrix cells. - Pace like the classics: one idea, one motion, a pause (
wait_for) to let it land.