Skip to content

Instantly share code, notes, and snippets.

@skynet
Created December 19, 2018 18:11
Show Gist options
  • Save skynet/02c1cf269b511033c7330a2169a61c12 to your computer and use it in GitHub Desktop.
Save skynet/02c1cf269b511033c7330a2169a61c12 to your computer and use it in GitHub Desktop.
Mapping a rectangular grid to a circular space
function map(x, y) {
return [
x * Math.sqrt(1 - y * y / 2),
y * Math.sqrt(1 - x * x / 2)];
}
@skynet
Copy link
Author

skynet commented Dec 19, 2018

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment