cale * tan((x - (w / 2)) * PI / (w - 1.)) + dx;
}

// returns 4 translation functions from/to screen and real coordinates
// types: LINEAR, ATAN
const LINEAR = 0;
const ATAN = 1;
function s2x_x2s_s2y_y2s(type, center_x, center_y, scale) {
	if(type == LINEAR) {
		return [
			function(i) {return linear_screen_to_real(i, center_x, scale, w);},
			function(x) {return linear_real_to_screen(x, center_x, scale, w);},
			function(i) {return linear_screen_to_real(h - i, center_y, scale, h);},
			function(y) {return 