#include <pinside.h>
Note that an error in that article ("count-" should have been "count--") has been corrected here.
Definition at line 67 of file pinside.h.
Data Structures | |
struct | line |
Internal line definition for pinside. More... | |
struct | point |
Internal point definition for pinside. More... | |
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_base &xa, const o2scl::ovector_base &ya) |
Determine if point (x,y) is inside a polygon. | |
template<class vec_t > | |
int | inside (double x, double y, size_t n, const vec_t &xa, const vec_t &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 . |
int inside | ( | double | x, | |
double | y, | |||
size_t | n, | |||
const vec_t & | xa, | |||
const vec_t & | ya | |||
) | [inline] |
This returns 1 if the point (x,y) is inside the polygon defined by xa
and ya
, and 0 otherwise.
The parameter n
should be the number of polygon points specified in vectors xa
and ya
.
Note that if the point (x,y) is exactly on the polygon, then the result of this function is not well-defined and it will return either 0 or 1.
int inside | ( | double | x, | |
double | y, | |||
const o2scl::ovector_base & | xa, | |||
const o2scl::ovector_base & | ya | |||
) |
int intersect | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2, | |||
double | x3, | |||
double | y3, | |||
double | x4, | |||
double | y4 | |||
) | [inline] |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page