map a square to a circle

JavaScript
function map(x, y) {
	return [
    	x * Math.sqrt(1 - y * y / 2),
        y * Math.sqrt(1 - x * x / 2)];
}
Source

Also in JavaScript: