Public
Edited
May 20
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
code = {
const A = (b) => Math.round(Math.random() * (b - 1)) * (360 / b);
let res = "";
for (let i = 0; i < rows; ++i) {
for (let j = 0; j < cols; ++j) {
const p = {
x: σ * w + j * σ * w * 2,
y: σ * w + σ * i * w * 2
};
res += `<use href="#t8" x="${p.x}" y="${p.y}" transform="rotate(${
0 + A(8)
}, ${p.x}, ${p.y})"/>
<use href="#t4" x="${p.x - σ * w}" y="${p.y - σ * w}" transform="rotate(${
45 + A(4)
}, ${p.x - σ * w}, ${p.y - σ * w})"/>`;
}
}
return res;
}
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