Published
Edited
Jun 3, 2021
1 fork
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Defining the branches of x^x
function x2x(x, k) {
if (math.abs(x) < 0.000001) {
return math.complex(1, 0);
} else {
var z = math.complex(x);
var twoPiI = math.complex(0, 1).mul(2 * math.pi);
return math.exp(z.mul(z.log().add(twoPiI.mul(k))));
}
}
Insert cell
thread = (k) => [
d3.range(-4, 2, 0.001).map(function (x) {
let xx = x2x(x, -k);
return [2 * x, xx.re, xx.im];
}),
d3.range(-4, 2, 0.001).map(function (x) {
let xx = x2x(x, k);
return [2 * x, xx.re, xx.im];
})
]
Insert cell
Insert cell
// There will be 2*N+1 of branches or threads
N = 15
Insert cell
// Multiplicative factor by which the transparency of higher order branches are dimmed
T = 1.08
Insert cell
Insert cell
import { Range } from "@observablehq/inputs"
Insert cell
import { create_tube } from '@mcmcclur/space-curves-and-tubes'
Insert cell
import {
show_x3d,
create_indexedLineSet,
create_arrow
} from "@mcmcclur/x3dom-primitives"
Insert cell
math = require("mathjs@9")
Insert cell
d3 = require("d3-selection@2", "d3-array@2")
Insert cell
// Supress the annoying dashed box that appears around X3Dom display.
html`<style>
canvas {
outline: none;
}
</style>`
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