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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more