Public
Edited
Feb 18, 2024
1 fork
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function ITCnt(lambda, N = 100) {
let f = F(lambda);
return function it_cnt(z0) {
let n = 0;
let z = math.complex(z0);
while (z.abs() <= 42 && n < N) {
z = f(z);
n = n + 1;
}
return n;
};
}
Insert cell
function F(lambda) {
let Lambda = math.complex(lambda);
return (z) => Lambda.mul(z.mul(z.neg().add(1)));
}
Insert cell
function invF(Lambda) {
let lambda = math.complex(Lambda);
function inv(Z) {
let z = math.complex(Z);
let s = lambda.mul(z.mul(-4).add(lambda)).sqrt().div(lambda.mul(2));
return [s.add(0.5), s.mul(-1).add(0.5)];
}
return inv;
}
Insert cell
function inv5(Lambda) {
let lambda = math.complex(Lambda);
let invf = invF(lambda);

let invs = [math.complex(0.499, 0.000123)];
for (let i = 0; i < 5; i++) {
invs = invs.map(invf).flat();
}
return invs;
}
Insert cell
math = require("mathjs")
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