#include <pinside.h>
This is a fast and dirty implementation of the point inside polygon test from Jerome L. Lewis, SIGSCE Bulletin, 34 (2002) 81.
Note that an error in that article ("count-" should have been "count--") has been corrected here.
Definition at line 45 of file pinside.h.
Public Member Functions | |
int | intersect (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) |
Determine if two line segments intersect. | |
int | inside (double x, double y, const o2scl::ovector_view &xa, const o2scl::ovector_view &ya) |
Determine if point (x,y) is inside a polygon. | |
int | test (test_mgr &t) |
Perform some simple testing. | |
Protected Member Functions | |
int | intersect (line P, line Q) |
Test if line segments P and Q intersect. | |
int | inside (point t, point p[], int N) |
Test if point t is inside polygon p of size N . | |
Data Structures | |
struct | line |
Internal line definition. More... | |
struct | point |
Internal point definition. More... |
int intersect | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2, | |||
double | x3, | |||
double | y3, | |||
double | x4, | |||
double | y4 | |||
) | [inline] |
int inside | ( | double | x, | |
double | y, | |||
const o2scl::ovector_view & | xa, | |||
const o2scl::ovector_view & | ya | |||
) |