Published
Edited
Jun 4, 2021
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plot(z)
Insert cell
function plot(z) {
const r = equation.fna(z);
const u = hx+hy*Math.cos(a*z)*r/m;
const v = hy+hy*Math.sin(b*z)*r/m;
ctx.fillRect(u, v, 1, 1);
}
Insert cell
equations = [
{ label: "R = 1", fna: z => 1 },
{ label: "R = SIN(2*Z)", fna: z => Math.sin(2*z) },
{ label: "R = SIN(7*Z)", fna: z => Math.sin(7*z) },
{ label: "R = 1+2*COS(Z)", fna: z => 1+2*Math.cos(z) },
{ label: "R = 1*COS(Z)", fna: z => 1*Math.cos(z) },
{ label: "R = 1+SIN(2*Z)", fna: z => 1+Math.sin(2*z) },
{ label: "R = 1+2*COS(2*Z)", fna: z => 1+2*Math.cos(2*z) }
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ctx = DOM.context2d(...size)
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