map square to circle code example
Example 1: map a square to a circle
function map(x, y) {
return [
x * Math.sqrt(1 - y * y / 2),
y * Math.sqrt(1 - x * x / 2)];
}
Example 2: map square to circle
function map(x, y) {
return [
x * Math.sqrt(1 - y * y / 2),
y * Math.sqrt(1 - x * x / 2)];
}