Published
Edited
Jun 24, 2019
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Möbius transformation that maps (0, 1, ∞) to (-1, 0, 1)
function transform_point(x, y) {
const d = (x + 1) * (x + 1) + y * y;
return [(x * x - 1 + y * y) / d, 2 * y / d];
}
Insert cell
// The image of a circle under the Möbius transformation
function transform_circle(x, y, r) {
return circle_through_points(
transform_point(x - r, y),
transform_point(x + r, y),
transform_point(x, y + r)
);
}
Insert cell
// The unique circle passing through three non-collinear points
function circle_through_points([ax, ay], [bx, by], [cx, cy]) {
const na = ax * ax + ay * ay;
const nb = bx * bx + by * by;
const nc = cx * cx + cy * cy;
const dy = 2 * (by - ay) * (bx - cx) - 2 * (ax - bx) * (cy - by);
const y = ((ax - bx) * (nb - nc) - (bx - cx) * (na - nb)) / dy;
const x = (na - nb + 2 * (by - ay) * y) / (2 * (ax - bx));
const r = Math.hypot(x - ax, y - ay);
return [x, y, r];
}
Insert cell
function crot(z, theta) {
return cmul(z, [Math.cos(theta), Math.sin(theta)]);
}
Insert cell
function cmul([wr, wi], [zr, zi]) {
return [wr * zr - wi * zi, wr * zi + wi * zr];
}
Insert cell
root = doyle(p, q)
Insert cell
doyle = require("https://bl.ocks.org/robinhouston/raw/6096562/8a03f4253b2908482f191e58627b6ededfe64250/doyle.js").catch(() => window.doyle)
Insert cell
//https://bl.ocks.org/robinhouston/raw/6096562/8a03f4253b2908482f191e58627b6ededfe64250/doyle.js
md`
[code](https://bl.ocks.org/robinhouston/raw/6096562/8a03f4253b2908482f191e58627b6ededfe64250/doyle.js)
`
Insert cell
d3 = require("d3@5")
Insert cell
import {slider, checkbox, color, select} from "@jashkenas/inputs"
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