Published
Edited
Jan 14, 2019
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
clothoid_plot = () => bezpts_to_svgpath(
bezeval(clothoid, [-maxs, maxs], viewport, tolerance), digits)
Insert cell
offset_clothoid_plot = (offset) => bezpts_to_svgpath(
bezeval(offset_clothoid(offset), [-maxs, maxs], viewport, tolerance), digits)
Insert cell
dFresnelC = vals2coeffs(pts.map(s => Math.cos(s*s)))
Insert cell
dFresnelS = vals2coeffs(pts.map(s => Math.sin(s*s)))
Insert cell
FresnelC = cumsum(dFresnelC).map(c => .5 * maxs * c)
Insert cell
FresnelS = cumsum(dFresnelS).map(c => .5 * maxs * c)
Insert cell
clothoid = (s) => {
const t = (Math.abs(s) * 2 / maxs) - 1;
const ss = Math.sign(s);
return [ss * evaluate(FresnelC, t), ss * evaluate(FresnelS, t)]
}
Insert cell
offset_clothoid = (offset) => (s) => {
const t = (Math.abs(s) * 2 / maxs) - 1;
const ss = Math.sign(s);
return [
ss * evaluate(FresnelC, t) - offset*evaluate(dFresnelS, t),
ss * evaluate(FresnelS, t) + offset*evaluate(dFresnelC, t)]
}
Insert cell
pts = chebpts(npts).map(t => .5 * maxs * (t + 1))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {chebpts, vals2coeffs, evaluate, diff, cumsum} from '@jrus/cheb'
Insert cell
import {bezeval, bezpts_to_svgpath} from '@jrus/bezplot'
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