Public
Edited
Feb 15
Insert cell
Insert cell
// viewof interval = Inputs.radio(intervals, {label: "Interval", value: intervals[8], format: x => x.interval})
Insert cell
t = Fraction(controls.N,controls.D)
Insert cell
t.valueOf()
Insert cell
t.toFraction()
Insert cell
Insert cell
Insert cell
plomp = _.curry((f1, f2) => {
const {min, max, exp} = Math;
const fmin = min(f1, f2);
const fmax = max(f1, f2);
const s = 0.24 / ( 0.021 * fmin + 19);
return (exp(-3.5 * s * (fmax - fmin)) - exp(-5.75 * s * (fmax - fmin)))
})
Insert cell
consdiss = d3.range(250, 1000, 1).map(plomp(250))
Insert cell
Plot.plot({
nice: true,
x: {domain:[200,1000]},
marks: [
Plot.line(consdiss, {x: (_,i) => i+200, y: d => d})
]
})
Insert cell
curve = ParamCurve(
// t => Math.sin(interval.ratio[0] * t + Math.PI / 2),
// t => Math.cos(interval.ratio[1] * t)
t => Math.sin(Fraction(controls.N,controls.D).n * t + Math.PI / 2),
t => Math.cos(Fraction(controls.N,controls.D).d * t)
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// import {intervals} from "@martien/interval"
Insert cell
Insert cell
// import { inputsGroup } from "@bumbeishvili/input-groups"
Insert cell
// import { slider, select } from "@jashkenas/inputs"
Insert cell
Insert cell
// d3 = require("d3@6")
Insert cell
Fraction = require("fraction.js@4.0")
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