From 778b6619924a62beb9aa77d73d61a97b4e880e48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9s=20Mej=C3=ADa?= Date: Fri, 7 Oct 2011 15:58:54 -0500 Subject: [PATCH] Cleaning up --- 11665 - Chinese Ink/11665.2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/11665 - Chinese Ink/11665.2.cpp b/11665 - Chinese Ink/11665.2.cpp index 2a4cd47..512853f 100644 --- a/11665 - Chinese Ink/11665.2.cpp +++ b/11665 - Chinese Ink/11665.2.cpp @@ -109,8 +109,12 @@ bool point_in_box(double x, double y, } -int direction(int pix, int piy, int pjx, int pjy, int pkx, int pky) { - return (pkx - pix) * (pjy - piy) - (pky - piy) * (pjx - pix); +/* + Returns the cross product of the segment that goes from (x1, y1) to (x3, y3) + with the segment that goes from (x1, y1) to (x2, y2) +*/ +int direction(int x1, int y1, int x2, int y2, int x3, int y3) { + return (x3 - x1) * (y2 - y1) - (y3 - y1) * (x2 - x1); } /* -- 2.11.4.GIT