Public
Edited
Dec 3, 2023
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
m = 25;
Insert cell
function f(t) {
return Math.exp(Math.pow(Math.cos(u * t), 2) + Math.sin(u * t)) - 3 * Math.cos(4 * u * t);};
Insert cell
function data(i) {
return Array.from({length: range}, (_, t) => {
return {x: .04 * i * f(t) * Math.cos(u * t), y: .04 * i * f(t) * Math.sin(u * t)} })}
Insert cell
Plot.plot({
grid: true,
marks: [
Plot.frame(),
Array.from({length: m}, (_, i) => {
return Plot.dot(data(i), {x: "x", y: "y", fill: Math.floor(m / 2) + 1 - i, r:.5})})
],
x: { domain: [-6, 6]},
y: { domain: [-4, 6]},
color: {scheme: "RdBu", domain:[0, Math.floor(m / 2)]},
style: {background: 'lightgray'},
height: 600,
width: 600
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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