Derivative as Tangent Slope
Drag a point along a parabola and watch the tangent line update live. Shows the geometric meaning of the derivative.
here's f(x) = x²
scene plane { x: [-5, 5] y: [-5, 5] grid axes param t = 0 { range: [-3, 3] } bool show = false curve f = x^2 { color: primary } point p = (t, t^2) { drag: x -> t, color: accent } line tangent { through: p, slope: 2*t, style: dashed, show: show } label at (t, t^2+0.6) = "slope = ${2*t}" { show: show } slider t { label: "move the point" } toggle show { label: "show tangent line" } step "here's f(x) = x²" step "the tangent at any point x has slope 2x" { set: { show: true } } step "drag the point, watch the slope update" { animate: { t: 3 }, dur: 2000, ease: easeInOut } }