23 #ifndef O2SCL_PINSIDE_H 24 #define O2SCL_PINSIDE_H 30 #include <boost/numeric/ublas/vector.hpp> 32 #include <o2scl/test_mgr.h> 33 #include <o2scl/vector.h> 35 #ifndef DOXYGEN_NO_O2NS 107 double x3,
double y3,
double x4,
double y4) {
122 int inside(
double x,
double y,
const ubvector &xa,
137 template<
class vec_t>
138 int inside(
double x,
double y,
size_t n,
const vec_t &xa,
148 ubvector xb(n), yb(n);
157 for(
size_t i=0;i<n;i++) {
163 for(
size_t i=0;i<n;i++) {
164 if (yb[i]==ymin && xb[i]<xmin) {
169 vector_rotate<vec_t,double>(n,xb,ix);
170 vector_rotate<vec_t,double>(n,yb,ix);
173 for(
size_t i=0;i<n;i++) {
189 #ifndef DOXYGEN_NO_O2NS The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
Test line intersection and point inside polygon.
A class to manage testing and record success and failure.
int intersect(line P, line Q)
Test if line segments P and Q intersect.
void vector_copy(const vec_t &src, vec2_t &dest)
Simple vector copy.
Internal line definition for pinside.
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.
static const double x3[11]
int inside(point t, point p[], int N)
Test if point t is inside polygon p of size N.
int intersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Determine if two line segments intersect.
static const double x4[22]
int test(test_mgr &t)
Perform some simple testing.
static const double x2[5]
Internal point definition for pinside.
static const double x1[5]