#include "scbutil.h"#include <math.h>#include <glib.h>#include <scblog.h>Go to the source code of this file.
Functions | |
| int | CCW (const ScbPointPtr p0, const ScbPointPtr p1, const ScbPointPtr p2) |
| gboolean | Intersect (const ScbPointPtr p1, const ScbPointPtr p2, const ScbPointPtr p3, const ScbPointPtr p4) |
| gboolean | scb_is_rect_intersect (const ScbRectPtr r1, const ScbRectPtr r2) |
| gboolean | scb_is_lines_intersect (const ScbPointPtr p1, const ScbPointPtr p2, const ScbPointPtr p3, const ScbPointPtr p4) |
| int CCW | ( | const ScbPointPtr | p0, | |
| const ScbPointPtr | p1, | |||
| const ScbPointPtr | p2 | |||
| ) |
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.
Definition at line 42 of file scbutil.c.
00043 { 00044 long dx1, dx2 ; 00045 long dy1, dy2 ; 00046 00047 dx1 = p1->x - p0->x ; dx2 = p2->x - p0->x ; 00048 dy1 = p1->y - p0->y ; dy2 = p2->y - p0->y ; 00049 00050 /* This is basically a slope comparison: we don't do divisions because 00051 00052 * of divide by zero possibilities with pure horizontal and pure 00053 * vertical lines. 00054 */ 00055 return ((dx1 * dy2 > dy1 * dx2) ? 1 : -1) ; 00056 }
| gboolean Intersect | ( | const ScbPointPtr | p1, | |
| const ScbPointPtr | p2, | |||
| const ScbPointPtr | p3, | |||
| const ScbPointPtr | p4 | |||
| ) |
| gboolean scb_is_lines_intersect | ( | const ScbPointPtr | p1, | |
| const ScbPointPtr | p2, | |||
| const ScbPointPtr | p3, | |||
| const ScbPointPtr | p4 | |||
| ) |
| gboolean scb_is_rect_intersect | ( | const ScbRectPtr | rect1, | |
| const ScbRectPtr | rect2 | |||
| ) |
1.5.6