Created
December 19, 2018 18:11
-
-
Save skynet/02c1cf269b511033c7330a2169a61c12 to your computer and use it in GitHub Desktop.
Mapping a rectangular grid to a circular space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map(x, y) { | |
return [ | |
x * Math.sqrt(1 - y * y / 2), | |
y * Math.sqrt(1 - x * x / 2)]; | |
} |
Author
skynet
commented
Dec 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment