 	disable_axes();
 }
 
+/* go to the given axes position from current motors position */
+void absolute_steps(int16_t x, int16_t y) {
+	if (x < X_AXIS_LIMIT_MIN) return;
+	if (x > X_AXIS_LIMIT_MAX) return;
+	if (y < Y_AXIS_LIMIT_MIN) return;
+	if (y > Y_AXIS_LIMIT_MAX) return;
+	relative_steps(x - current_position_x, y - current_position_y);
+}
+
+/* convert absolute point to absolute axes steps */
+void absolute_point(int32_t x, int32_t y) {
+	double n = sqrt(x * x + y * y + Z_SQARE);
+	double a = asin(y / n);
+	absolute_steps(round(STEPS_PER_RADIAN * asin(x / n / cos(a))), round(STEPS_PER_RADIAN * a));
+}
+
 /* set the current laser position to (0, 0) for trigo to work */
 void set_home() {
 	current_position_x = 0;

}

void go_to(int16_t x, int16_t y) {
	absolute_steps(x * draw_scale + draw_x, y * draw_scale + draw_y);
}

void draw_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {


#define SERIAL_BAUDRATE				(115200)
#define SERIAL_BUFFER_SIZE			(60)
#define STEPS_DELAY_MS				(5)
#define BEZIER_SEGMENTS				(30)
#define STEPS_PER_RADIAN			(648.68)
#define Z_SQARE						(10000) // 19600

#define X_AXIS_A_PIN				(4)
#define X_AXIS_B_PIN				(5)
