From bc6d98a53441bfc51bfc8aa8dd379583e1de2fa8 Mon Sep 17 00:00:00 2001 From: Daniel Bernard Date: Sun, 28 Oct 2018 18:13:27 -0500 Subject: [PATCH] Expand pow(#, 2) to optimize math in nx_touch --- nx_main/nx_touch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx_main/nx_touch.c b/nx_main/nx_touch.c index 49b6200..6abed40 100644 --- a/nx_main/nx_touch.c +++ b/nx_main/nx_touch.c @@ -14,7 +14,7 @@ #define LAUNCH_BUTTON_START_X 1092 #define LAUNCH_BUTTON_END_X 1200 -#define distance(x1, y1, x2, y2) (int) sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)) +#define distance(x1, y1, x2, y2) (int) sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))) struct touchInfo_s touchInfo;