Dear Bruno,
the line
int yEdge = map(0, -115, x1, 160, y1); could be written as:
int yEdge = 160 + 115 *tan(1.57078 -x1);
It derives from the formula:
a = b * tan(arc); with given arc, b.
The hard coded values are:
1.5708 = PI/2,
and from your setup: 160 -> y_0 and 115 -> length of x...