double RealTransformX(double oldx,double oldy) {
	double x;
	switch (rot) {
	default:
	case 0:	x = oldx; break;
	case 1:	x = -oldy; break;
	case 2:	x = -oldx; break;
	case 3:	x = oldy; break;
	case 4:	x = -oldx; break;
	case 5:	x = -oldy; break;
	case 6:	x = oldx; break;
	case 7:	x = oldy; break;
	}
	return x*scale + orgx;
    }