Published
Edited
Jun 3, 2021
1 fork
16 stars
Also listed in…
Math
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

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