Skip to content

Instantly share code, notes, and snippets.

View README.md

My friend Colin has been trying to give me a better intuition for higher dimensions. His first fun fact was that the volume of an n-dimensional hypersphere peaks somewhere around n=6 or so, I forget, and then approaches 0 as n approaches infinity. Damn! Meanwhile, of course the volume of a hypercube just diverges to infinity, as you'd expect. So if you inscribe a hypersphere in a hypercube, as dimension increases, more and more of the volume is in "the corners" — ultimately, almost all of it.

That's not what I'm trying to show here, it's just cool. This is somewhat different.

Colin also pointed out that, in a high-dimensional multivariate random normal distribution (with identity covariance matrix), all the mass ends up coming to be found in a sort of donut at some distance from the middle. There's very little mass in the middle. Of course the origin is still the mean/median/mode. The problem is that the middle is just so dang small, and there's SO MUCH SPACE as you go a little further out. So if you're jus

View README.md

Pinch apart to split the viewport in two, so you can do parallel reading. Pinch together to recombine. Only tested on iPhone & iPad; should work on other multitouch devices?; doesn't do anything (or make any sense) on non-touch single-pointer mouse/trackpad devices, whatever we're calling that classic category these days. But you can see it demo'ed in this tweet.

WHY:

The Web is missing lenses and mirrors and such, I think — images! maps! — fundamental mechanics for getting various views on the same underlying content. We have the freedom to paint any pixel according to any arbitrary rule, and yet it's weirdly hard to . . . like, hold your place in a long document, as one would with a finger marking a page in a book as you skim ahead. Sometimes I highlight the last sentence I read with the mouse so it jumps out when I scroll back up, which is a nice near-unconscious hack that takes advantage of something I know about how document state work

View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
overflow: visible;
}
path {
View README.md

Swizzling! (Or pandas DataFrame "reshaping" / "pivoting" / "(un)stacking".)

Click and drag the i,j,k in the upper right to reorder. Refresh for random dimensions.

One can imagine more spreadsheety stuff, extending to 4D arrays and higher, and aggregating/slicing/collapsing/folding along different dimensions.

No, I'm not at all sure I'm using the term "swizzle" correctly. I don't understand matrices.

View README.md
View .block
height: 960
@tophtucker
tophtucker / .block
Last active Jan 15, 2017 — forked from mbostock/.block
CMYK Wave Motion
View .block
license: gpl-3.0
@tophtucker
tophtucker / .block
Last active Apr 26, 2019
Trump support vs. distance from major city
View .block
license: gpl-3.0