Published
Edited
Jan 16, 2021
1 fork
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
r = u => Math.exp(u) + Math.exp(-u) + 1
Insert cell
Insert cell
Insert cell
x = u => Math.exp(u) / (Math.exp(u) + 1)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Wormhole theta, u to screen 3d coordinates
xyz = ([th, u]) => [
Math.sin(th * Math.PI * 2 / c.th_steps) * r(u),
Math.cos(th * Math.PI * 2 / c.th_steps) * r(u),
-x(u)
];
Insert cell
// Orth projection to screen coordinates
view = ([x, y, z]) => [
x * c.rx,
y * c.ry + z * c.rz + c.rz
]
Insert cell
loop = c.s*u_step * 2
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3-scale-chromatic@1", "d3-interpolate@1")
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