Public
Edited
Jul 5, 2023
1 fork
Insert cell
Insert cell
Insert cell
f = x => x**3
Insert cell
fprime = x => 3*x**2
Insert cell
approx = x => (f(x + delta) - f(x - delta))/(2*delta)
Insert cell
Plot.plot({
x:{domain:[-10,10]},
y:{domain:[-1000,1000]},
marks:[
Plot.ruleX([0]),
Plot.ruleY([0]),
Plot.line(x,{x:x,y:x.map(x => x**3),stroke:"red"})
]
})
Insert cell
Plot.plot({
x:{domain:[-10,10]},
y:{domain:[-1000,1000]},
marks:[
Plot.ruleX([0]),
Plot.ruleY([0]),
Plot.line(x,{x:x,y:x.map(x => 3*x**2),stroke:"red"})
]
})
Insert cell
viewof delta = Inputs.range([.00001,10])
Insert cell
Plot.plot({
x:{domain:[-10,10]},
y:{domain:[-1000,1000]},
marks:[
Plot.ruleX([0]),
Plot.ruleY([0]),
Plot.line(x,{x:x,y:x.map(x => approx(x)),stroke:"red"})
]
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more