Published
Edited
Dec 6, 2021
1 star
Insert cell
Insert cell
Insert cell
// You can edit this to generate your own tile.
A = [
[2, -2],
[2, 0]
]
Insert cell
Insert cell
Insert cell
IFS = {
let AInv = math.inv(A);
return new IteratedFunctionSystem(
base_digit_set(A).map(
(d) => new AffineFunction([AInv, d]) // math.multiply(AInv, d)
)
);
}
Insert cell
Insert cell
basic_picture = IFS
// .iterate(3) // Uncomment this to generate a higher order tiling
.render_stochastic({
n: 200000,
colors: true,
image_width: width < 800 ? width : 800
})
Insert cell
Insert cell
base_digit_set(A)
Insert cell
Insert cell
Insert cell
Insert cell
digit_pic(A)
Insert cell
Insert cell
D = [
[0, 0],
[1, 1],
[-1, 0],
[0, -1]
]
Insert cell
differentD = {
let AInv = math.inv(A);
return (
new IteratedFunctionSystem(D.map((d) => new AffineFunction([AInv, d])))
//.iterate(3) // Uncomment this to generate a higher order tiling
.render_stochastic({
n: 200000,
colors: true,
image_width: width < 800 ? width : 800
})
);
}
Insert cell
Insert cell
Insert cell
different_basis = {
let S = [
[1, -1 / 2],
[0, math.sqrt(3) / 2]
];
let SAInvSInv = math.multiply(S, math.inv(A), math.inv(S));
return (
new IteratedFunctionSystem(
D.map((d) => new AffineFunction([SAInvSInv, math.multiply(S, d)]))
)
//.iterate(3) // Uncomment this to generate a higher order tiling
.render_stochastic({
n: 200000,
colors: true,
image_width: width < 800 ? width : 800
})
);
}
Insert cell
Insert cell
Insert cell
evd = new mlm.EigenvalueDecomposition(A)
Insert cell
is_expansive = evd.d[0] ** 2 + evd.e[0] ** 2 > 1 &&
evd.d[1] ** 2 + evd.e[1] ** 2 > 1
Insert cell
det = A[0][0] * A[1][1] - A[0][1] * A[1][0]
Insert cell
Insert cell
import { base_digit_set, digit_pic } from "@mcmcclur/self-affine-tiles"
Insert cell
import {
AffineFunction,
IteratedFunctionSystem,
shift,
rotate,
degree,
pi
} from "@mcmcclur/iteratedfunctionsystem-class"
Insert cell
mlm = require("ml-matrix")
Insert cell
math = require("mathjs")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more